There's more than one way to do things | |
PerlMonks |
Re^4: Operator precedence of unary plus (Bug or Feature)by LanX (Saint) |
on Feb 05, 2012 at 18:22 UTC ( [id://951969]=note: print w/replies, xml ) | Need Help?? |
>This actually surprised me, I would have expected Perl to apply the same heuristics as the OP encountered. I remember discussing here that "print FILEHANDLE" has a special magic different from normal "indirect object" syntax. but the parsing of bar Foo +6; is not really as dangerous as print $x +6 is. If Foo was a constant, any association to the package Foo would be overwritten.
But in the OP $q doesn't hold a filehandle. UPDATE: Maybe the whole confusion started, when variables for filehandles were introduced.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|