Do you know where your variables are? | |
PerlMonks |
Creating a hash with key generated by a sub?by smullis (Pilgrim) |
on Nov 12, 2004 at 12:53 UTC ( [id://407342]=perlquestion: print w/replies, xml ) | Need Help?? |
smullis has asked for the wisdom of the Perl Monks concerning the following question: Hello All... I'm having a problem generating hash keys using a sub. I'm pretty sure that this is a syntactic error and while I could easily "do it another way" I'm just curious as to why this occurs....
Let's set it all up:
Here's the sub function:
This works great...
Not this though:
But Why? Whereas, here we have no problem...
Anyone care to help me understand what's going on here? I intuitively think it should be fine.... which is why I ask... Many thanks in advance,
Cheers SM
Back to
Seekers of Perl Wisdom
|
|