Re: Need help with variables

2006-03-05 Thread Foo Ji-Haw
If you've defined your $DBH in common.pm, then to access it you have to include the namespace: my $sth = $common::DBH->prepare(".."); And in your common.pm, use our instead of my to share the variable: our $DBH = DBI->connect ( "DBI:mysql:database=sample; host=127.0.0.1","root", "password")

Re: Need help with variables

2006-03-04 Thread Sisyphus
- Original Message - From: "Jaime Teng" <[EMAIL PROTECTED]> To: Sent: Friday, March 03, 2006 11:10 AM Subject: Need help with variables > Hi, > > In my current web project, I group common functions and global variables > into a separate file; > > my

Re: Need help with variables

2006-03-04 Thread Chris Wagner
At 11:10 AM 3/3/2006, Jaime Teng wrote: >Hi, > >In my current web project, I group common functions and global variables >into a separate file; > >my problem is, I could not seem to be able to access these variables Make it $common::DBH; $DBH is living in another namespace than ur main script so

Need help with variables

2006-03-03 Thread Jaime Teng
Hi, In my current web project, I group common functions and global variables into a separate file; my problem is, I could not seem to be able to access these variables ## common.pm use strict; use DBI; my $HTTP; my $DBH = DBI->connect ( "DBI:mysql:database=sample; host=127.0.0.1",