in reply to Re^6: Lost anonymous subs
in thread Lost anonymous subs
Well... this gets into a feature of for() and stops being about my(). for is special in that it aliases the "a", "b", and "c" variables over $m during the loop so even though you didn't say for my the effect is the same. So there's a sort of implicit my() happening there anyway. What you'll notice though, is that if you used strict, the implicit my() won't take care of making sure that variable is declared so you'd still have an error unless you said it as for my or if the loop variable already existed outside the loop.
At this point, however, you may just want to start reading the output of things like Devel::Peek::Dump, perl -MO=Concise your_script.pl, and reading pp_enteriter in pp_ctl.c.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Lost anonymous subs
by kappa (Chaplain) on Dec 10, 2004 at 16:23 UTC |