Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Question regarding variable scopeby hanenkamp (Pilgrim) |
on Oct 17, 2003 at 02:34 UTC ( [id://299925]=note: print w/replies, xml ) | Need Help?? |
This is being a little picky, but I noted you used:
in the code snippet. This prototype will work, but isn't strictly correct. It would be better to say:
I also noted that some of the replies used:
This is bad. If you call this method after this declaration, then a call like find_pairing("Bob") will fail because the prototype will accept no arguments. It would be better to say nothing about the signature of the subroutine like:
Anyway, you're all probably aware of this, but I wanted to make sure the casual browser, who might not, knows the difference between these slight variations. I look forward to Perl 6, where this cruft will be cleaned up.
In Section
Seekers of Perl Wisdom
|
|