in reply to access to the variable in other pm
make sure your module 1 exports the symbol you want
if say..
main.cgi is doing
use TEST1; use TEST2;
and TEST1.pm is exporting $dbaccess as...
package TEST1; use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK}; require Exporter; @ISA = qw(Exporter); @EXPORT = qw($dbaccess); # just to calling package ! $VERSION = '0.01'; use strict; my $dbaccess= 'whatever';
then TEST2.pm would...
$main::dbaccess->prepare('yo 5h1+3'); #or .. $TEST1::dbaccess->prepare('yo 5h1+3'); # play around.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: access to the variable in other pm
by blazar (Canon) on Feb 03, 2006 at 11:50 UTC |