Can anyone explain the following phenomenon, or is it a bug in perl?

The code:

use warnings;

print 5 + 7, "\n";
print "5" + 7, "\n";
print "5&6" + 7, "\n";


The output:

Argument "5&6" isn't numeric in addition (+) at - line 5.
12
12
12


So is "5&6" numeric or not? The warning says it isn't, but the
addition evaluates to 12! Shouldn't non-numeric strings evaluate to
zero?


Jason
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl

Reply via email to