http://www.perlmonks.org?node_id=946606

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?