Appended is a short perl script. It produces a different output
depending on whether you use perl4.036 or perl5.001m. I would be
interested to hear an explanation of why this is so, and why the perl5
behaviour is not a bug if it is not, because it is certainly not what
I would have expected.
Note that if you don't include the $c in the expressions then the
output of perl4 and perl5 are the same!
Thanks for your help.
Martin
----------------------------------------------------------------------
#! /usr/bin/perl -w
$a = 0;
$b = 1;
$c = 0;
$tester = "result:";
$tester .= (!$a && !$b && !$c); # if you use (!$a && !$b) in these, then
$tester .= ($a && $b && $c); # there is no difference perl4 <-> perl5
print "$tester\n";
----------------------------------------------------------------------
With perl 4 I get:
result:00
With perl 5 I get:
result:0
Que?
[This was posted to comp.lang.perl.misc but got no response :-( ]
depending on whether you use perl4.036 or perl5.001m. I would be
interested to hear an explanation of why this is so, and why the perl5
behaviour is not a bug if it is not, because it is certainly not what
I would have expected.
Note that if you don't include the $c in the expressions then the
output of perl4 and perl5 are the same!
Thanks for your help.
Martin
----------------------------------------------------------------------
#! /usr/bin/perl -w
$a = 0;
$b = 1;
$c = 0;
$tester = "result:";
$tester .= (!$a && !$b && !$c); # if you use (!$a && !$b) in these, then
$tester .= ($a && $b && $c); # there is no difference perl4 <-> perl5
print "$tester\n";
----------------------------------------------------------------------
With perl 4 I get:
result:00
With perl 5 I get:
result:0
Que?
[This was posted to comp.lang.perl.misc but got no response :-( ]