Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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


Comment on Re: Can't match my regex
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793915]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-02 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls