b888 has asked for the wisdom of the Perl Monks concerning the following question:
Greetings all.
I'm trying to export some variables from module. While using filename same as package all seems ok.
file 'A.pm'
file 'B.pl'package A; use strict; BEGIN { use Exporter(); use vars qw(@EXPORT @ISA); @EXPORT = qw($var1); @ISA = qw(Exporter); } use vars @EXPORT; $var1 = "1";
#!/usr/bin/perl package B; use strict; use A; print "$var1\n";
But when i'm trying to use package name that differs form filename, strict raises an error.
file 'A1.pm'
package A; ...
file 'B.pl'
Is this perl problem, or i'm doing something wrong?... use A1; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: exporting vars
by PodMaster (Abbot) on Nov 08, 2004 at 11:59 UTC | |
|
Re: exporting vars
by Thelonius (Priest) on Nov 08, 2004 at 12:39 UTC | |
|
Re: exporting vars
by fergal (Chaplain) on Nov 08, 2004 at 13:36 UTC |