[EMAIL PROTECTED] wrote:
...
My question is how to access $dbaccess variable (object) defined and
initialized in test.pm within test2.pm module?
If $dbaccess is delared with 'my' in test.pm, you cannot directly access
it from another file. You have two basic options:
1. Provide an accessor
*dbaccess = \$test::dbaccess;
print $dbaccess; #the same as 'print $test::dbaccess;'
-Original Message-
>From: [EMAIL PROTECTED]
>Sent: Feb 2, 2006 11:50 AM
>To: beginners@perl.org
>Subject: scope of the variable?
>
>Hello All,
>I have following question re
Hello All,
I have following question regarding accessing variable from other module:
In test.pm I have following:
#BEGIN OF THE TEST.PM
package test;
use strict;
use warnings;
#
# The object responsible for managing the database connections.
#
my $dbaccess = undef;
-somewhere else
$dbaccess =