Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
in config.pm i have following code:lib.cgi config.pm and login.cgi
in lib.cgi i have following code:package config; our $abcd = 1; 1;
in login.cgi i have following code:use config; 1;
on compiling this I get an error. The error goes away if i "use config" in login.cgi. I thought since I am including lib.cgi inside login.cgi I would not have to use config inside login.cgi Please help me understand this betteruse strict; required 'lib.cgi'; print $config::abcd;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Modules Scope ?
by Anonymous Monk on Oct 02, 2015 at 06:07 UTC | |
|
Re: Perl Modules Scope ?
by Laurent_R (Canon) on Oct 02, 2015 at 07:34 UTC | |
|
Re: Perl Modules Scope ?
by u65 (Chaplain) on Oct 02, 2015 at 10:31 UTC | |
|
Re: Perl Modules Scope ?
by locked_user sundialsvc4 (Abbot) on Oct 03, 2015 at 12:33 UTC |