in reply to Re: Re: Exporter usage?
in thread Exporter usage?

You can, but only if $CGI is not declared using my. This means either a use vars '$CGI'; or our $CGI (or don't declare it at all and don't use strict, but you should use strict).


Confession: It does an Immortal Body good.

Replies are listed 'Best First'.
Re: Re: Re: Re: Exporter usage?
by Anonymous Monk on Sep 02, 2002 at 04:08 UTC
    Still doesn't work:
    package Foo; use strict; require Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); @EXPORT_OK = qw($CGI); @EXPORT = qw($CGI); use CGI; our $CGI = new CGI; die $CGI; # I tried the export stuff down here, too 1; ----- use Foo qw($CGI);
    returns
    "$CGI" is not exported by the Foo module at..

      Hm. I was prepared to appolgize for posting without testing, and being wrong thereby... but all I can say is that it works fine for me... so long as I put the first and second parts of this in different files. Otherwise, I get an error because there is no Foo.pm -- are you sure you're picking up the right file?


      Confession: It does an Immortal Body good.

        Finally got it.. user error :-( Thanks for the push that kept me going to get it to work.