in reply to Re^2: when is "my" not necessary?
in thread when is "my" not necessary?

Only lexicals have scope which is why they're "the right thing". You can learn all this and more by reading perldata. RTFM.