in reply to CGI Module
The problem with the code you posted is that my $forms is a completely different variable from $main::form. The former is a lexical variable, the latter a package variable. See perldoc -q lexical.
Can you tell us more about the module you that you want to access CGI data from? Is it an OO class? If so, you could design the class so that it (or its instances) contain a reference to a CGI object (a has-a relationship). If it is not an OO class, you may have to pass the CGI object as an additional argument to the functions in the module, or else have a package-level configuration variable for the module to hold a reference to some CGI object, and provide a method to set this configuration variable from the calling code.
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI Module
by Anonymous Monk on Jun 05, 2005 at 03:43 UTC | |
by brian_d_foy (Abbot) on Jun 05, 2005 at 04:11 UTC | |
by tlm (Prior) on Jun 05, 2005 at 04:03 UTC | |
by Anonymous Monk on Jun 05, 2005 at 04:13 UTC |