First what I've though was that the parens are causing the problem like in print:
$rh=1; $dist=1; print ($rh and $dist) ? 2 : -2
But quick check
#!perl sub aa { $rh=shift; $dist=shift; return ($rh and $dist) ? 2 : -2; } print aa;
has showed me I was wrong :) But I want to point at the issue - be very careful with paren at the beginning of parameters' list.
In reply to Re: faulty expression prob
by grizzley
in thread faulty expression prob
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |