Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Can't match my regex

by Melly (Hermit)
on Sep 07, 2009 at 09:44 UTC ( #793915=note: print w/replies, xml ) Need Help??

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.

map{$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
Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793915]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-06-26 13:21 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (580 votes). Check out past polls.