in reply to Unique variable names & 'strict vars'

You can still do the use vars trick, you just have to change packages when you do it:

package CONFIG; use vars '$foo'; package main;
Substitute whatever package you started from for main.

The most radical approach I've seen for this is in Slashcode, which sets up a WARN handler that eats any message starting with the string "Possible typo". TIMTOWTDI, although that's a little overkill for my taste....

HTH

Replies are listed 'Best First'.
Re: Re: Unique variable names & 'strict vars'
by vladb (Vicar) on Dec 20, 2001 at 06:33 UTC
    Or, incidentally, this works too:
    #!/usr/local/bin/perl -w use strict; { package CONFIG; use vars qw($foo); } ....
    Putting 'package ' inside a a block eliminates the need to return back to the main package via 'package main' call. ;-)

    "There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith