Hi,
That was the problem (I thought I had already answered to the list but
it was just to Rhet).
Going a little futher on the answer I found that the CGI.pm header
shows that :standard just imports almost everything. The export_tag's
to avoid is :cgi and :all which is a superset of :cgi. If you want to
use CGI.pm to make HTML, use :html and :form.
I have one question, though. In Cees' message it suggests that people
should use the OO interface to CGI.pm, that's what I was doing. Was
there a way for me to know I was overloading the param operator?
I see my problem has raised an interesting debate but it goes beyond
my knowledge. My OOP knowledge is quite basic but my intuition says
that a method I define in a derived class should have precedence over
a method from a base class. Am I wrong?
César
On 7/3/05, Rhet Turnbull <suppressed> wrote:
> By the way, I meant to include a link to the previous message on this
> list from Cees Hek that first enlightened me to this problem. A
> snippet is quoted in the email I sent you and the message can found
> here:
>
> http://www.mail-archive.com/suppressed/msg02900.html
>
> --Rhet
>
> On 7/2/05, Rhet Turnbull <suppressed> wrote:
> > My guess is you've got "use CGI qw(:standard);" in your code. CGI.pm
> > has a param method that gets imported and overrides the C::A param
> > method if you use :standard option for CGI.pm. Omit that and see if
> > the problem goes away.
> >
> > This drove me absolutely crazy when first learning C::A. In fact, I
> > never did figure this out until I saw a post a few months ago on the
> > list from someone having the same problem as you. I created my own
> > param method (not called param by the way) in my app to get around
> > this since. In my opinion, it would be nice if C::A provided an alias
> > to param that's not called 'param'.
> >
> > --Rhet
> >
> > 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.
> >
> > On 7/2/05, Cesar Alba <suppressed> wrote:
> > > Hi,
> > >
> > > I've upgraded my desktop to Fedora Core 4 and, after a lot of work
> > > making CGI's work (security issues), I've run into a PERL problem with
> > > passing parameters.
> > >
> > > I had a code in my previous OS (Fedora Core 3) that worked propoerly.
> > >
> > > This snippet used to work. It's taken from the documentation page
> > > ---------------
> > > $webapp->param('CONFIG'=>\%CONFIG,
> > > 'PARAM'=>\%PARAM,
> > > );
> > > ----------------
> > >
> > > But now, when I try to retrieve the value of the parameter 'CONFIG' I
> > > just get the string 'CONFIG' so a code like this
> > > my %CONFIG=%{$self->param('CONFIG')};
> > > doesn't work.
> > >
> > > If I call $webapp->param(), it returns an array with all parameter
> > > names and values.
> > > ---------------
> > > print STDERR Dumper($self->param())
> > > $VAR1 = 'CONFIG';
> > > $VAR2 = {
> > > 'URLBASE' => 'http://sitid.cpd.hi.inet/fotos/',
> > > 'LDAP_HOST' => 'localhost:38900',
> > > 'LDAP_BASE' => 'o=TID'
> > > };
> > > $VAR3 = 'PARAM';
> > > $VAR4 = {};
> > > --------------
> > >
> > > I can get a workaround of this but I guess something is broken
> > > somewhere. Has anyone the same problem? Any idea of how can it be
> > > fixed?
> > >
> > > My system runs:
> > > perl -V
> > > Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
> > > Platform:
> > > osname=linux, osvers=2.4.21-27.0.2.elsmp, archname=i386-linux-thread-multi
> > > uname='linux decompose.build.redhat.com 2.4.21-27.0.2.elsmp #1 smp
> > > wed jan 12 23:35:44 est 2005 i686 i686 i386 gnulinux '
> > >
> > > And the CGI::Application I am using is:
> > > $CGI::Application::VERSION = '4.01';
> > >
> > > --
> > > Thanks
> > > César
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
>
--
Saludos
César
---------------------------------------------------------------------
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.