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 u have to reference that namespace. It would be a good idea to put all ur db variables in the common package so u never have to worry about cross package naming. Then do all ur db access via the exported functions from common. Don't put any db variables in the main script. That's how I do it. > >############## >common.pm >use strict; >use DBI; >my $HTTP; >my $DBH = DBI->connect ( "DBI:mysql:database=sample; host=127.0.0.1", >"root", "password"); -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs