himik has asked for the wisdom of the Perl Monks concerning the following question:
Hello. Why this is not returning 0 when the regex is false?
sub TestIt { my ($p1,$p2,$p3,$p4)=@_; print "p1=$p1,p2=$p2,p3=$p3,p4=$p4\n"; } my ($a1,$a2,$a3,$a4)=(1,2,3,4); &TestIt($a1,$a2,$a3=~m/2/,$a4);
when $a3=~m/3/ every thing is ok, but when it is false it is not parsing 0. And the parameters is 1 less. When i use $a2==3 it parse the 0. Can someone explain it to me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is this normal
by toolic (Bishop) on Jan 06, 2012 at 15:24 UTC | |
|
Re: Is this normal
by JavaFan (Canon) on Jan 06, 2012 at 15:20 UTC | |
by dave_the_m (Monsignor) on Jan 06, 2012 at 23:30 UTC | |
by JavaFan (Canon) on Jan 07, 2012 at 08:45 UTC | |
|
Re: Is this normal
by roboticus (Chancellor) on Jan 06, 2012 at 14:55 UTC |