P0w3rK!d has asked for the wisdom of the Perl Monks concerning the following question:
I have a piece of code calls a function in a module A. That function calls a function in module B along with using one of the global variables in module B as an argument to that function.
The error is as follows:package Foo::A; use 5.008; use strict; use warnings; require Exporter; #use AutoLoader qw(AUTOLOAD); use Carp; use Foo::B ':all'; our @ISA = qw(Exporter); @EXPORT or @EXPORT_OK our %EXPORT_TAGS = ( 'all' => [ qw( aMethod ... ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw(); our $VERSION = '1.00'; ... sub aMethod { bMethod("$OURVAR test data"); } ... 1; __END__ ############################################3 package Foo:B; use 5.008; use strict; use warnings; require Exporter; #use AutoLoader qw(AUTOLOAD); our @ISA = qw(Exporter); our %EXPORT_TAGS = ( 'all' => [ qw( bMethod $OURVAR ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw(); our $VERSION = '1.00'; # something like this sub bMethod { my $foo = shift; print "$foo\n"; } ... 1; __END__
Use of uninitialized value in concatenation (.) or string at C:/Perl/site/lib/Foo/B.pm line 141.
The error refers to the $OURVAR which is exported by the "B" module along with the bMethod().
Why am I getting this error? How do I fix it?
Thank you :)
-P0w3rK!d
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Use of uninitialized value in concatenation (.) or string
by japhy (Canon) on May 20, 2003 at 14:28 UTC | |
by P0w3rK!d (Pilgrim) on May 20, 2003 at 15:16 UTC | |
Re: Use of uninitialized value in concatenation (.) or string
by KPeter0314 (Deacon) on May 20, 2003 at 14:48 UTC | |
by P0w3rK!d (Pilgrim) on May 20, 2003 at 15:18 UTC | |
by KPeter0314 (Deacon) on May 20, 2003 at 22:21 UTC | |
Re: Use of uninitialized value in concatenation (.) or string
by Joost (Canon) on May 20, 2003 at 14:43 UTC |