Re: scope of the variable?

2006-02-03 Thread Bob Showalter
[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

Re: scope of the variable?

2006-02-03 Thread Jeff Pang
*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

scope of the variable?

2006-02-02 Thread bogum
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 =