Dan Muey wrote:
Any thoughts?

Erm, it looks okay. Maybe if you showed a complete example and the error or warnings (or misbehavior) somebody would see the problem.

Here's what I was using.

    BEGIN {
        package Foo;
        use base qw(Exporter);
        use strict;

        our @EXPORT_OK = qw($var);
        our $var = 'Foo!';

        sub import {
            my ($class) = @_;
            $class->export_to_level(2, @_);
            strict->import;
        }

        $INC{'Foo.pm'} = __FILE__;
    }

    use Foo qw($var);
    print $var;

The first code you posted didn't work because (as James pointed out)
you were never calling Exporter::import.

If you called "strict->import" but never loaded strict.pm, the import()
would quietly fail to turn on strictures.

But delegating to Exporter with export_to_level() or by using the magic
goto() should work...

--
Steve

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to