Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
After you create the C::A instance, you can always stick it in a global variable:
A variable like $::global_var is a fully-qualified name which is as close as Perl gets to global variables. It is equivalent to $main::global_var or to using our in package main:
You can create a tie interface if you want to access parameters like you did with a hash. See man perltie for more details. However, if you are writing new CGI applications, I wouldn't do this. Just extract parameters into simple variables if you need to use them more than once. A tie interface would allow you to use hash-like syntax for the following operations: However, I would make sure it is really worth implementing because it will add complexity and degrade your application performance. If you really need to access the values as a hash, perhaps you can first extract all the CGI parameters to a hash like this:
In reply to Re: CGI::Application - alternative to using $self->param?
by pc88mxer
|
|