in reply to strange boolean algebra behaviour
The problem is that and has very loose precedence, looser than the assignment operator. So you need to write $a && $b or ($a and $b). See perlop for more details.
In Perl 5, the false value is represented as an empty string that can numify to 0 without a warning. That's what you are seeing in your second attempt.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: strange boolean algebra behaviour
by vlad_tepesch (Acolyte) on Apr 04, 2012 at 10:25 UTC | |
by Anonymous Monk on Apr 04, 2012 at 19:27 UTC | |
|
Re^2: strange boolean algebra behaviour
by remiah (Hermit) on Apr 05, 2012 at 05:27 UTC | |
by Anonymous Monk on Apr 05, 2012 at 06:54 UTC | |
by remiah (Hermit) on Apr 05, 2012 at 15:21 UTC |