![]() |
|
more useful options | |
PerlMonks |
namespace crazinessby mkmcconn (Chaplain) |
on Jan 30, 2001 at 07:41 UTC ( [id://55172]=perlmeditation: print w/replies, xml ) | Need Help?? |
There are discoveries at every bend on the road to Perl enlightenment. One of the most distracting of these, for me, has been Perl's complex and diverse kinds of namespaces. I came up with the following simple snippet, when I was experimenting to train myself to recognize (mostly-)namespace gotchas. Seasoned monks may not find this very surprising or interesting, but if you're new as I am, I think it's worth meditating on. Read this closely:
Do you know what it will print? Do you know where the values came from? mkmcconn UPDATE: I just found this, where tilly shows a very similar behavior. Update:
And on the way there, I tried the following with amusing results (which proves tye's point made to me in CB, that the => operator is not just a cute comma: And then, this from out of left field:
Hopefully, I wouldn't even think of doing anything like these, in real life. How would you easily know where the whacky numbers are coming from?
Back to
Meditations
|
|