The expression $english && $foreign will evaluate to either true (1) or false ("") but will never be equal to '-1'.
Wrong. The "&&" operator doesn't return 1 or "". It returns the expression on the right side of "&&" if and only if both expressions are true.
use 5.010; my $english = 'foobar'; my $foreign = -1; say ($english && $foreign); # says "-1" say ($foreign && $english); # says "foobar"
In reply to Re^2: Hash Printing reveals Hash Memory Location
by tobyink
in thread Hash Printing reveals Hash Memory Location
by perlStuck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |