in reply to Re: Matching multiple variables against array
in thread Matching multiple variables against array

Thanks for your help

I am confused by this bit tho and how I can get the different form values into @form

my @form = map { $cgi->param("form$_") } 0..21;

When trying to run this at the mo. I get the error message: Can't call method "param" on an undefined value line 31 which is where the above line sits.

Thanks again
  • Comment on Re^2: Matching multiple variables against array

Replies are listed 'Best First'.
Re^3: Matching multiple variables against array
by parv (Parson) on Mar 02, 2006 at 03:42 UTC
    When trying to run this at the mo. I ...

    What do you mean by "mo."?

    It seems you have been using only the functional interface of (i assume) CGI.pm or equivalent module. Object oriented interface was used in ikegami's reply, where $cgi was some CGI* object. If you just use param( ... ) instead of $cgi->param( ... ), you should get moving along.

    Also, it looks like you are not using warnings & strict pragmas. If you were, you would have seen different error message.

      What do you mean by "mo."?
      Sorry I meant at the moment.

      I am using the below pragmas for warnings.

      #!/usr/bin/perl -wT
      use strict;
      use CGI ':standard';
      use CGI::Carp qw(fatalsToBrowser);


      Have tried using just param( ... ) but I am still not moving :-(

      How can i get the below incoming values into @form ?
      $1 = param('1');
      $2 = param('2');
      $3 = param('3');

      Thanks