in reply to Exporting scalars from a module
The problem is the my(...). This declares a whole bunch of lexically scoped variables, which are completely different to the symbols in the @EXPORT array. Things in the @EXPORT... structures are things in the packages symbol table - and lexically scoped variables are most definitely not in the symbol table.
I'll say again - the things in the my() are not the same as the things in the @EXPORT array. This is the crux of your issue.
The quickest solution is to change the my to our (if your perl has this new-ish keyword) or change the my to use vars qw(...) and remove the commas in the list.
The longer solution is to read every article in Tutorials on variables. Only then may you claim true mastery.package thingy; use warnings; use strict; use Exporter; use vars qw(@ISA @EXPORT $VERSION); use vars qw($PACKAGE_REQUEST_ID $BUGNUMBER $KBARTICLE $DISTMETHOD $MIN +SP $MAXSP $ISNONINSTALLINGPKG $JOBBRANCHNAME $HOTPATCHBINARIES $BINAR +IESAFFECTED $BUGTITLE); @ISA = qw(Exporter); @EXPORT = qw(Execute GetValue $PACKAGE_REQUEST_ID $BUGNUMBER $KBARTICL +E $DISTMETHOD $MINSP $MAXSP $ISNONINSTALLINGPKG $JOBBRANCHNAME $HOTPA +TCHBINARIES $BINARIESAFFECTED $BUGTITLE); $VERSION = '1.00'; ...
+++++++++++++++++
#!/usr/bin/perl
use warnings;use strict;use brain;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Exporting scalars from a module
by chip (Curate) on May 03, 2004 at 15:32 UTC | |
by Anonymous Monk on Mar 19, 2005 at 01:55 UTC | |
by Tanktalus (Canon) on Mar 19, 2005 at 02:55 UTC |