But you should use anchors in your regex, otherwise it might match, where you don't want it to match
my $x = '5.1.1'; # OOPS if ( $x =~ m/5.1/ ) { print "'$x' is 5.1\n"; } # better if ( $x =~ m/^5.1$/ ) { print "'$x' is 5.1\n"; }
update: please read on at FunkyMonks post
In reply to Re^2: if elsif else question
by linuxer
in thread if elsif else question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |