saintex has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm trying to use a package structure, but I have some problems.
I have two scripts:
- myFile.pl;
- Config.pm;
I'm trying to include config.pm in myFile.pm,package Config; use strict; use warnings; our (@ISA,@EXPORT,$VERSION); use Exporter; @ISA=qw(Exporter); @EXPORT=qw($test DEFAULT_LOCAL_PATH ); $VERSION=0.01; use constant DEFAULT_LOCAL_PATH=>'something here'; my $test='hello'; 1;
use strict; use warnings; use FindBin; use lib "$FindBin::Bin"; use Config; print $test;
Global symbol "$test" requires explicit package name at miFile.pl line + 10. Execution of backup.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exporter problem
by almut (Canon) on Jun 03, 2010 at 16:49 UTC | |
by saintex (Scribe) on Jun 03, 2010 at 17:15 UTC | |
by saintex (Scribe) on Jun 03, 2010 at 20:04 UTC | |
by almut (Canon) on Jun 03, 2010 at 20:17 UTC | |
by saintex (Scribe) on Jun 04, 2010 at 06:18 UTC | |
by almut (Canon) on Jun 04, 2010 at 08:43 UTC | |
| |
by saintex (Scribe) on Jun 04, 2010 at 20:21 UTC | |
|
Re: Exporter problem
by toolic (Bishop) on Jun 03, 2010 at 16:48 UTC | |
by saintex (Scribe) on Jun 03, 2010 at 17:08 UTC |