in reply to Maintaining Symbol table state.

Is something preventing the use of local $foo = $foo?;?

Replies are listed 'Best First'.
(Ovid) Re: Re: Maintaining Symbol table state.
by Ovid (Cardinal) on Dec 07, 2001 at 00:38 UTC

    Hadn't considered that because I haven't seen this person's application. Here's part of what he wrote:

    If only life were so simple as to add "use strict" and declare variables. Unfortunately various of the Perl libraries we use do not pass this test and some of them make use of global variables. This could no doubt be fixed, but at the risk of breaking a zillion other sites.

    I could go on at length about some of the architectural problems, but unloading libraries which "require" in a context sensitive manner is another problem.

    Essentially, this person has been handed a C++ application that loads Perl for report processing and, for some reason, can't unload Perl, thus having the globals hang around for subsequent reports and corrupting output. I have no idea how extensive the Perl is, so I don't know if simply using local for the package variables is an option.

    If you want to see the full scope of the dilemma, check out the usenet post.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.