I believe this successfully exports the scalars because the interpreter doesn't complain when I access them from a pl file where use strict is enabled. However, when I try to access these variables, they are set to no value:use Exporter; use vars qw(@ISA @EXPORT $VERSION); @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'; my($PACKAGE_REQUEST_ID, $BUGNUMBER, $KBARTICLE, $DISTMETHOD, $MINSP, $ +MAXSP, $ISNONINSTALLINGPKG, $JOBBRANCHNAME, $HOTPATCHBINARIES, $BINAR +IESAFFECTED, $BUGTITLE); BEGIN { print "Begin has begun\n"; $PACKAGE_REQUEST_ID = "PackageRequestID"; $BUGNUMBER = "bugnumber"; $KBARTICLE = "kbarticle"; $DISTMETHOD = "distmethod"; $MINSP = "minsp"; $MAXSP = "maxsp"; $ISNONINSTALLINGPKG = "isnoninstallingpkg"; $JOBBRANCHNAME = "jobbranchname"; $HOTPATCHBINARIES = "hotpathbinaries"; $BINARIESAFFECTED = "binariesaffected"; $BUGTITLE = "bugtitle"; print "PRI is $PACKAGE_REQUEST_ID\n"; }
prints "WHAT VALUE?\n". What am I doing wrong?print "WHAT VALUE? $PACKAGE_REQUEST_ID" . "\n";
In reply to Exporting scalars from a module by sonic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |