Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm looking foward to retreiving a input from an html form. However one of the html form input names must be specified by a scalar variable I have, so it looks like this:
$INPUT->param('about$cur_num')
However when trying to use this, I get the value of below, and not the actual form input value.
CGI=HASH(0x15d58ac)->param('about1') CGI=HASH(0x15d58ac)->param('about2') CGI=HASH(0x15d58ac)->param('about3')
What can I do to prevent this?

Thanks

Replies are listed 'Best First'.
Re: Retreiving CGI.pm input
by merlyn (Sage) on Feb 09, 2006 at 22:10 UTC
    I'm guessing you're trying to do that within a double-quoted string. And a double-quoted string doesn't support method calls like that. Thus, you're getting the C<$INPUT> CGI object interpolated, followed by the literal string beginning with the method arrow.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Re: Retreiving CGI.pm input
by Anonymous Monk on Feb 09, 2006 at 21:53 UTC
    hi, here you go.
    $INPUT->param('about' . $cur_num)


    that should get you the proper value.
    tanger