> Heres what I did:
> I had many scripts in one dir that shared many things; subroutines, global
> variables and modules.  I wanted to clean things up, so I created a module
> called global.pm structured like this:

<snip>

> The custom stuff scripts all end in 1;, and are loaded with my custom
> subroutines.  For example, I have one called cgi.pl, that
> contains all subs
> for cgi related tasks, i.e. checkUser(), which verifies a users cookie.
>
> Each cgi simply calls 'use global;' and then off we go.  However, after
> moving all this stuff into /perl, none of the subs in the custom .pl files
> are found, I get a complaint:
> Undefined Subroutine &Apache::ROOT::compar_2ecgi::checkUser
> called at .....
>
> compare.cgi calls 'use global;' and then 'checkUser()'.

global.pm isn't exporting the symbol names it's defining.
if you were to refer to global::checkUser() in one of your scripts, and it
worked, then mebbe an EXPORT() list for global.pm is in order

so that the function names get defined in the package
(Apache::ROOT::compar_2ecgi, made up by apache on the spot)
that is accessing them.

HTH!

L8r,
Rob

Reply via email to