> 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) = @_;
                      ^^^^^^^^^^^^^^
This line (my version not Steve's) was keeping me from doing export_to_level() 
properly.
I was doing my $class = shift; but I needed to keep $class in @_ like Steve did above

Now it works!!!

>              $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...

I wonder which one would be fastest export_to_level() or goto() ??

Thanks Steve and everyone for all the help! You guys, this list, and Perl 
all rock!!!!!

> 
> -- 
> 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