hello.
I've tryed to use some variables declared into my package "test.pm" in my script "test.pl". I work under "Windows XP".
"test.pl"
-----------------------------------------------------------
use strict ;
use lib('E:\Program Files\EasyPHP1-8\cgi-bin\devis') ;
use test;
print "$var1\n" ;
sub_test();
use lib('E:\Program Files\EasyPHP1-8\cgi-bin\devis') ;
use test;
print "$var1\n" ;
sub_test();
"test.pm"
-----------------------------------------------------------
package test ;
BEGIN{
use Exporter ;
our @ISA = qw(Exporter) ;
our @EXPORT = qw ($var1 &sub_test) ;
}
my $var1 = 100 ;
sub sub_test{
print "Sub sucessfully imported" ;
}
1;
END{}
BEGIN{
use Exporter ;
our @ISA = qw(Exporter) ;
our @EXPORT = qw ($var1 &sub_test) ;
}
my $var1 = 100 ;
sub sub_test{
print "Sub sucessfully imported" ;
}
1;
END{}
-----------------------------------------------
Results : the subroutine has been successfully imported when the variable $var1 is undefined. If someone can give me a basic sample which turns, or can show me what errors I've done, it will be very nice.
Thanks
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
