XP is just a number | |
PerlMonks |
Re^2: Bareword Package Namesby martin (Friar) |
on Aug 08, 2012 at 16:16 UTC ( [id://986319]=note: print w/replies, xml ) | Need Help?? |
What tobyink demonstrated is that a bareword will act as a procedure call if (and only if) a subroutine of that name is known. Perl's auto-quoting of barewords will only kick in in the absence of such a subroutine. Any kind of explicit quoting, of course, will also avoid procedure calls.
So we now have established by different examples that trailing double-colons can act like quoting. There may be caveats though. In some places where perl looks for barewords, the package-quoted bareword does not seem to lose its bareword-likeness.
Perl has to distinguish whether print with a single argument is called as print HANDLE or print LIST, and apparently uses a rather simple heuristic for this. I try to avoid ambiguity with print and always use the print HANDLE LIST syntax for printing to handles.
In Section
Seekers of Perl Wisdom
|
|