in reply to require & $main::variables

The code:
use foo qw/bar $baz/;
is the same as:
# Do this at compile time.... BEGIN { # load if needed require foo; # import functionality foo->import('bar', '$baz'); }
Most errors (not this one, but most) where a require did not do what a use would are missing the import.

UPDATE
As merlyn points out, if your require does not match what you expected from use, and it wasn't a missing import, then likely you need the BEGIN block. Or else (as in this case) it is an unrelated mistake and the use wouldn't have worked either.

Replies are listed 'Best First'.
Re: Re (tilly) 1: require & $main::variables
by merlyn (Sage) on Apr 04, 2001 at 04:24 UTC
    Most errors (not this one, but most) where a require did not do what a use would are missing the import.
    ... or the fact that it's in a BEGIN block.

    -- Randal L. Schwartz, Perl hacker