Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Checking for Arguments before Usage?by nickcave25 (Acolyte) |
on Feb 09, 2000 at 10:41 UTC ( [id://3241]=perlquestion: print w/replies, xml ) | Need Help?? |
nickcave25 has asked for the wisdom of the Perl Monks concerning the following question:
Is it required (or at least a good idea) to confirm that arguments feeding into subroutines are actually specified?
If so, how do you do it? This situation is giving me problems: Note: the commented-out statement is my attempt at a solution for this quandry. And here's the quandry: When this executes, I get a "Use of initialiized value" error regarding the reference to $_0 in the print command within the definition of LI(). I want to be able to both feed arguments into LI() (when I call it from other places) and _not_ feed in arguments (as in this instance). Is there a way to set up that subroutine to allow for both cases? TIA.
Back to
Seekers of Perl Wisdom
|
|