I've created the file with DB connection info and some other basic stuff and am using "require ./config.pl" in each of the scripts. The problem is that variable declaration in config.pl aren't avaliable in the other scripts. So after connecteing to the DB using the subroutine in config.pl $dbh and $sth aren't exported. The variables in question are initalised outside the subroutines but are in config.pl.
Also passing variables from the running script into a subroutine in config.pl seems to be impossible too, although I suspect thats all related to a namespace type problem. My understanding was that require effectivly made the files into one long file but apparently not
In reply to CGI and require by snorks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |