|P is for Practical|
Re: Failing to warn about "Found = in conditional"by ww (Chancellor)
|on Apr 17, 2012 at 02:18 UTC||Need Help??|
Yes, you can "turn off some warnings" as you ask in your first sentence, but it appears that you really want your nix box to issue one. Why it fails to do so, I can't say, but the same behavior occurs with AS Perl 5.014 sub 2 on a Win 7 box.
That seems odd, since the single equals sign is an assignment; the message you cite correctly suggests using == in the conditional. The rest is merely an expansion on dasgar's observation:
FWIW, with alternate code,
one receives the expected values,
and restoring the single equals sign in the conditional
... also produces the expected (but incorrect, if I understand you correctly) sequence of output,
I can only guess the Perl version on your Mac is slightly better at noting the problem.
Update: Corrected typos and bad markup... but also noted that you say the Mac version cites an error at line 36. It's line 21 in the code you posted... and even allowing for a hashbang and a blank line, that doesn't match well with "36." Is there something else in the code on either machine that you didn't show us that might explain the mystery?