Just another Perl shrine | |
PerlMonks |
Messing with @_by TGI (Parson) |
on May 29, 2008 at 20:52 UTC ( [id://689088]=perlquestion: print w/replies, xml ) | Need Help?? |
TGI has asked for the wisdom of the Perl Monks concerning the following question: Far too often I find myself having to check a bunch of input args for definedness. It's annoying, and this annoyance is almost definitely the reason for defined-or in Perl 5.10. However, I need a solution that works in older perls. I came up with an idea that seems to work, but it works by messing about with @_. This makes me nervous. Anyone care to tell me why this code is dangerous? I've got two routines to munge @_. One changes the source array, called fix_undef(), which seems like bad news to me. The other, called no_sfx_fix_undef() seems to be safe. So, as far as my limited brain can tell, the second function is safe to use unless I plan on using @_ to modify the original routine's arguments. Any other gotchas I should know about?
Back to
Seekers of Perl Wisdom
|
|