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

[cgiapp] newbie question: param()


Hi Everybody!

I have just installed CGI::Application a few hours ago and am taking my first steps with this module. Unfortunately I have had major problems even running a generic application generated by CGI::Application::Generator. It might be something really obvious, but I have been trying to find out what is going wrong, read the manual twice, analyzed several demo applications but am still not able to figure out what's going wrong. I hope you'll forgive me pestering you with this newbie question.

My problems boil down to the fact that I don't seem to be able to set/get any Application parameters. Please consider the following example:

use strict;
use warnings;


use base qw/CGI::Application/;

sub setup {
        my $self = shift;

#setting a simple string scalar parameter with name 'testparamname' and value 'testparamvalue'... At least that's what I am *trying* here.
        $self->param('testparamname','testparamvalue');
        #getting the parameter value again
        print "\r\nmy parameter value:".$self->param('testparamname')."\r\n";
        ...
        }

Now, the problem is that this code actually prodoces the output "my parameter value: testparamname". So self->param() seems to return the parameter name, not it's value.

It's obvious that I must be missing something, but what is it? I've really run out of ideas.

Thanks in advance for your help!,



Adrian Grigore

--
Adrian Grigore
suppressed
Lobstersoft - Fun Brain-Bending Games For All Ages
http://www.lobstersoft.com



---------------------------------------------------------------------
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.