in reply to Re^6: Using an "outer" lexical in a sub?
in thread Using an "outer" lexical in a sub?

The file-scoping is annoying I guess, but sort of in line with lexical scoping rules. And I haven't used perl 5.005 in ages.

You have 2 files that access one package and you introduce synchronization issues.
How does that happen? I though our() just made package variables available without too much fuss.
  • Comment on Re^7: Using an "outer" lexical in a sub?

Replies are listed 'Best First'.
Re^8: Using an "outer" lexical in a sub?
by tilly (Archbishop) on Nov 02, 2006 at 03:06 UTC
    You say "package Foo" in two different files. :-)

    As I said, this should be very rare. But sometimes you want to add or modify functionality in a package someone else wrote. (I've done this several times in Ruby where I'm changing core classes.)

    However there is a more common variation of the same thing. If you take a module and refactor it by using AutoLoader, then our variables are not visible in the autoloaded subroutines, but use vars would be.