Front page | perl.beginners |
Postings from February 2012
perl and pattern
Thread Next
From:
Vyacheslav
Date:
February 21, 2012 11:47
Subject:
perl and pattern
Message ID:
4F43F4DB.6060309@gmail.com
Hello.
I'm new in perl and have many questions.
This my first programm.
#!/usr/bin/perl
use strict;
use warnings;
my $number = 0;
my $_ = 0;
print "Enter number:";
chomp($number = <>);
if ( $number = /[0-9]/) {
print "you number $number\n"
}
./firsh.pl
Enter number: 23
I thought, what print was
"you number 23"
but result was
"you number 1"
How i can return 23, if pattern match.
Thread Next
-
perl and pattern
by Vyacheslav