in reply to variables across modules

You're right, it doesn't work.

Seriously, %hash is a lexical variable. The whole point of lexical variables is that they're not available outside of their scopes. %hash is scoped to the enclosing file.

The quick and dirty solution is to make %hash a global variable, probably with the vars pragma. I take issue with this comment, though:

But this is not possible in our real code.

It's just software. I change software all the time.

Replies are listed 'Best First'.
Re: Re: variables across modules
by liz (Monsignor) on Aug 02, 2003 at 20:25 UTC
    This "bug/feature" is particularly annoying when changing module code to make use of in-time loading, such as with AutoLoader, SelfLoader and load: your package lexicals cannot been seen by any subroutine loaded at runtime. ;-(

    Liz