[cgiapp] params, params, params...

Bruce McKenzie bruce at 2MinuteExplainer.com
Fri Feb 8 16:02:28 EST 2008


Mark Knoop wrote in an email message dated 2/7/2008 5:34 AM:

> 
 > Also I see that CGI::Application has its own params - am I right in
 > thinking these are completeley different to the query params? Is there
 > any relationship between the two? Should I just be using these for
 > 'global' values?

I use a SuperWebApp module as the base for applications, as described in 
the documentation.

This can be used to get and set global items:

$self->param(
         username  => $username,
         host      => $host,
);

later . . .

print $self->param('username');


CGIApp uses CGI.pm, so I get at the form or query data when I need it 
with this (in SuperWebApp.pm)

sub vars {
     my $self = shift;
     return $self->query->Vars;    #ref to cgi params hash
}

It avoids some confusion (for me) to be consistent in naming the params 
from CGI.pm  "$vars" as in
   my $vars = $self->vars;

HTH,

Bruce

-- 
Bruce McKenzie
Business Information Graphics
New York

http://www.2MinuteExplainer.com


More information about the cgiapp mailing list