in reply to Source files, packages and name spaces
Thanks for the replies, guys. Broquaint's example makes clear what the problem is. Code occurring outside of any sub just gets executed in sequence -- the package statement doesn't alter that sequence of execution.
Things which *do* alter that sequence include reordering the code (broquaint), forcing its early execution with BEGIN (merlyn), or pulling it in early with require (my initial example).
FWIW, I'd read about the $a/$b trap on previous visits here. Guess that sort of thing doesn't sink in until you get burned by actually doing it -- at least that's how I've learned just about everything else :(
--Dinosaur
|
|---|