Prev: FAQ 7.26 How can I find out my current or calling package?
Next: FAQ 5.36 Why doesn't glob("*.*") get all the files?
From: Ilya Zakharevich on 31 Mar 2010 19:01 On 2010-03-31, Bo Lindbergh <blgl(a)hagernas.com> wrote: >> > { >> > my $strange=-0.0; >> > print $strange ? "$strange is true\n" : "$strange is false\n"; >> > print $strange ? "$strange is true\n" : "$strange is false\n"; >> > } >> >> This is a bug. Read-only access should not change the value. .... Reading string value of -0.0 changes TRUE/FALSE... > Would you call this example the same bug, a different bug, or not a bug? > { > my $strange="-0"; > print "- $strange == ", -$strange, "\n"; > my $ignored=0+$strange; > print "- $strange == ", -$strange, "\n"; > } .... Reading NUM value of "-0" changes the effect of unary minus. It looks like different bugs - but they may have the same fix.... ;-) > Ditto for this one. > { > my($one,$two)=("12","21"); > print "$one | $two == ", $one | $two, "\n"; > my $ignored=$one+$two; > print "$one | $two == ", $one | $two, "\n"; > } Not a bug - just a documented brokenness of |-operator... Hope this helps, Ilya |