Try removing "my" from all the variables in your module ... You're privatizing them to your module thereby excluding them from your external program ...
At least that's my guess! :^) HTH, Adam On Tuesday 04 May 2004 12:12 pm, Andrew Gaffney wrote: : I'm working on a small Perl-based webapp. I want to create a small include : file that all scripts will use. It looks like: : : <code> : use CGI; : use DBI(); : : my $cgi = new CGI; : my $dbh = DBI->connect("DBI:mysql:database=somedb;host=127.0.0.1", "user", : "pass"); my $p = $cgi->Vars; : my $uid = $cgi->cookie('uid'); : if($uid eq '') { : print $cgi->header; : print : "<html><script>location.replace('/cgi-bin/login.pl');</script></html>"; } : : 1; : </code> : : In my scripts, I do 'require "./common.pl";' but I get errors when I try to : use the variable defined in common.pl. Am I doing something wrong? Am I : going about this completely the wrong way? : : -- : Andrew Gaffney : Network Administrator : Skyline Aeronautics, LLC. : 636-357-1548 -- There is nothing more middle class than being afraid to look middle class. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>