in reply to Confused by symbol table import mechanism of 'use vars'

I can't find a good reference at the moment, but I believe the point of needing a different package is to make it hard to turn off 'strictness' for a variable by accident.

The typical case where you may need to alias a global is when you're Exporting variables, in which case you *are* in another package (though you'd normally use "Exporter" instead of doing it by hand).

  • Comment on Re: Confused by symbol table import mechanism of 'use vars'

Replies are listed 'Best First'.
Re^2: Confused by symbol table import mechanism of 'use vars'
by Anonymous Monk on Oct 30, 2007 at 11:12 UTC
    Just wanted to say a belated "Thanks!" for your explanation, Joost. (I assumed I'd be emailed if anyone responded to my post, and no emails arrived so I assumed no-one had responded; just came wandering back today! My bad.)

    While your explanation makes some sense, behaviour like what I described causes me to wonder about the designers of Perl: it seems like whenever they see an opportunity to implement something simply, cleanly and orthogonally, they do it the other way.

    Many thanks,
    JRH