[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Parameter name being returned


Hi Peter,

Please keep the responses on the list, so that we have a compete
thread in the archives for others to use in the future.  I'm sure you
won't be the only person to have run into this problem.

On Tue, 18 Jan 2005 07:37:45 -0800, Peter Fogg <suppressed> wrote:
> Good morning,
> 
> This is one context that I tried:
> 
> #!/usr/local/bin/perl5.8.5 -w
> 
> package kartingdata;
> use base 'CGI::Application';
> use HTML::Template;
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
> use strict;

You have a very subtle problem in the above code.  CGI.pm has a
'param' method, and you are importing that 'param' method with the
':standard' import group of functions.  So when you call $self->param,
you are actually getting the param method from CGI.pm.  So removing
the use CGI statement will fix your problem.

You shouldn't need to have that in your code anyway, as
CGI::Application gives you access to a CGI.pm object through
$self->query.  You will have to learn the object oriented interface to
CGI.pm, but I find it is much cleaner to use anyway.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.