The stupid question is the question not asked | |
PerlMonks |
Re^2: Built-in Function Homonyms for Method Names Bad, Too?by hv (Prior) |
on Jan 27, 2006 at 00:16 UTC ( [id://525878]=note: print w/replies, xml ) | Need Help?? |
The gotcha is that any attempts to use the builtins inside your module: return, split, delete, will result in calls to the subs in your package, not the builtins [...] I can't find a test case for this behaviour - do you have an example? There is a distinction between strong and weak keywords 1 which shows a slight difference in behaviour. With a strong keyword, the keyword overrides the subroutine:
A weak keyword gives a warning, but is still preferred to the subroutine:
I'm sure I'm missing something that would justify your comment, but I can't offhand think what it is. Hugo 1 The distinction between weak and strong keywords is probably not well documented; in older perls I think the only way to check was to examine the C code in toke.c, but happily perl-5.8.7 now bundle a script perl_keyword.pl to generate the code, which has clear lists of weak (@neg) and strong (@pos) keywords at the start of the script.
In Section
Seekers of Perl Wisdom
|
|