Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Heres the importing script :package testpack ; use strict ; use Exporter ; our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, $xyz) ; $VERSION = 0.99 ; @ISA = qw(Exporter) ; @EXPORT = qw($xyz) ; @EXPORT_OK = qw(&rtine) ; $xyz = 888 ; sub rtine { $xyz = 999 ; print "I\'m in the su-ub ! and xyz = $xyz \n" ; } 1;
When I run it, it doesn't import $xyz..use strict ; BEGIN{$Exporter::Verbose=1} use testpack ('&rtine') ; print "I\'m before the sub and xyz = $xyz \n" ; &rtine ; print "I\'m after the sub and xyz = $xyz \n" ;
No matter how I twist and turn, I can't export forcibly the variable and optionally the function. Been at this for a day and a half. Anyone have a tip for me ? Phil.Exporter::import('testpack', '&rtine') called at E:\Sites\packnew\cgi- +bin\test.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exporting forcibly and optionally, can both be done ?
by chipmunk (Parson) on Jun 21, 2001 at 18:17 UTC | |
by Anonymous Monk on Jun 21, 2001 at 20:28 UTC | |
|
Re: Exporting forcibly and optionally, can both be done ?
by Sifmole (Chaplain) on Jun 21, 2001 at 17:03 UTC | |
|
Re: Exporting forcibly and optionally, can both be done ?
by Anonymous Monk on Jun 21, 2001 at 21:36 UTC |