in reply to Can't match my regex
It works for me - can you run the following from the command-line and confirm that you don't get '0' printed?
perl -e "$l='Version: 0';($v)=$l=~/^Version:\s(\d)$/;print $v;"
Apart from that, are you testing $version at some moment? If so, it will be false ('0'), whereas ' 0' is not false... e.g.
perl -e "$l='Version: 0';($v)=$l=~/^Version:\s(\d)$/;print $v if $v;"
will not print the version.
Tom Melly, pm (at) cursingmaggot (stop) co (stop) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
|
---|
In Section
Seekers of Perl Wisdom