Phaysis has asked for the wisdom of the Perl Monks concerning the following question:
After having done this, the user only needs to do...sub new { #object blessing stuff skipped here... $self->_init(@_); return $self; } sub _init { my $self = shift; #the following creates the CGI object, importing the #method param() into current scope, _init() $self->{'query'} = new CGI qw(param); #...etc... }
...to access the value of the form variable "comment". I've tried different methods to make this work, but nothing has seemed to work short of creating a stub method in Request to forward any parameters and return context to the CGI::param() method.my ($comment) = $requestobj->param('comment');
Is there a way, while in the scope of _init(), to assign the imported method param() to the Request object? Would I have to use, perhaps, a sub reference? Would I have to rely on AUTOLOAD to form a forward call to any imported methods? I know that when _init() goes out of scope, the methods imported from CGI fail to exist; I want these methods to be sticky.
I am a-thoroughly confused. Thanks for any help.
-Shawn / (Ph) Phaysis
If idle hands are the tools of the devil, are idol tools the hands of god?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Importing CGI methods into a subclass as a class method
by Corion (Patriarch) on Feb 13, 2003 at 08:08 UTC | |
|
Re: Importing CGI methods into a subclass as a class method
by blokhead (Monsignor) on Feb 13, 2003 at 07:44 UTC | |
|
Re: Importing CGI methods into a subclass as a class method
by dragonchild (Archbishop) on Feb 13, 2003 at 14:54 UTC | |
by ihb (Deacon) on Feb 13, 2003 at 23:24 UTC | |
|
Re: Importing CGI methods into a subclass as a class method
by Phaysis (Pilgrim) on Feb 14, 2003 at 01:30 UTC | |
by ihb (Deacon) on Feb 14, 2003 at 01:48 UTC |