Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Stumped when passing barewordsby crenz (Priest) |
on Apr 22, 2004 at 12:00 UTC ( [id://347313]=perlquestion: print w/replies, xml ) | Need Help?? |
crenz has asked for the wisdom of the Perl Monks concerning the following question: Fellow monks, I'm working on a subroutine that I want to pass a bareword as parameter. While doing that, I stumbled upon a weird problem. Let's take this program
and run it. What would you expect is it's output? My expectation was
What was actually printed by the program is
Can any of the more enlightened monks explain to me why that happens? Obviously, it seems to be caused by the order of definition of the subroutines, but why? This is on v5.8.1-RC3 on Mac OS X 10.3.3, by the way.
Back to
Seekers of Perl Wisdom
|
|