XP is just a number | |
PerlMonks |
Re: groping @_ (judiciously)by Russ (Deacon) |
on Dec 16, 2000 at 00:27 UTC ( [id://46911]=note: print w/replies, xml ) | Need Help?? |
I have to weigh in against the "silently modify the arguments"
approach. Of course good (and very LOUD) documentation can
offset most of the danger, but most people don't expect to
have arguments modified by a subroutine.
IM(ns)HO, the occasional '\' is a very small price to pay for self-documenting code. If it strikes you as jarring, I think that is all the more reason to use it. You (and the one who maintains your code) will instantly recognize an atypical behavior when you see an unusual syntax in use. I don't think the @_ trick is evil. There is a time and place to use it, just like the &func construct (re-using the current @_), but it should only be used judiciously. Russ
In Section
Seekers of Perl Wisdom
|
|