in reply to Re: Re: Variable scoping outside subs
in thread Variable scoping outside subs

my has both compile-time and run-time effects. See Abigail's comment in Unusual Closure Behaviour, though that's not directly related to your problem. [and damn those spelling variations]

When the my line is commented out, I suspect that Perl is not complaining about the missing declaration because of the compile-time effect, even though the line is never executed.

-QM
--
Quantum Mechanics: The dreams stuff is made of