in reply to Re: if elsif else question
in thread if elsif else question

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