> Dan Muey wrote:
> >>sub import {
> >>    my $class = shift;
> >>    $class->SUPER::import(@_);
> >>    strict->import;
> >>}
> >>
> >> I believe that will fix it.  Not 100% sure though.  Never
> >> tried it.  ;)
> > 
> > I just tried it and no go. Any other thoughts anyone?
> 
> The problem here is that Exporter::import() looks at the 
> calling package, which in this case is Foo::Monkey *itself*, 
> not the user of Foo::Monkey.
> 

Makes sense, but it works without strict->import; in the package's sub import { }
Does that make sense? I'm stuck!

> Try this (a more general solution):
> 
>    sub import {
>        my ($class) = @_;
>        $class->export_to_level(2, @_);
>        strict->import;
>    }
> 
> Or this (simpler):
> 
>    sub import {
>        strict->import;
>        goto &Exporter::import;
>    }

I tried both and no go. All is well (IE the thigns specified 
are Exported to the script) if I do not have strict->import; (Which makes 
the script act as if they had 'use strict;' in the script)


I think we're getting there but I am missing somethgin that is probably simple and 
obvious.

Thanks a bunch

Dan

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