P is for Practical | |
PerlMonks |
Re: "my" declaration problemby davies (Prior) |
on Apr 25, 2017 at 11:29 UTC ( [id://1188835]=note: print w/replies, xml ) | Need Help?? |
Warnings would tell you that your repeated "my" masked a previous declaration. When you use "my", a new variable is created. If several of the same name are created in the same scope, only the last to be declared is accessible. Therefore, $me is "at work" if $v_place is "work" (simplified, I know), which it isn't. Therefore $me exists but has no value, which is what you are seeing. Regards, John Davies
In Section
Seekers of Perl Wisdom
|
|