|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Subroutine Referencesby Ninthwave (Chaplain) |
|
| on Dec 07, 2003 at 22:21 UTC ( #312978=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Ninthwave has asked for the
wisdom of the Perl Monks concerning the following question:
I have been playing with different styles and data structures, just trying to get a feel for perl better, and what I can do. I have been reading Perl Objects, References and Modules by Randal L. Schwartz. So I have seen what I can do with subroutine references. Now I am a subroutine prototyper by nature. In fact I do two things that seem to frustrate some fellow programers but it seems natural to me. I declare my subroutines before using them and prototype them at the same time. There are many reasons to do this, but a few is to catcht programming errors. The main being:
Now this code gives me: Now if I change the code like this: and And the output is fine. I can even leave it as: As long as I change the call to the sub to have the \@ it works. Am I missing something here or doing something silly. I am probably doing something silly but I can't see it. Any pointers or references would be appreciated. Sorry didn't see the pun in that until posted.
Update:
"No matter where you go, there you are." BB
Back to
Seekers of Perl Wisdom
|
|
||||||||||||