First: if you're using the OO interface, you don't need to import anything (which is what your qw(param standard) is supposed to do) (explanation: the list of names you pass the module when you use it tells it that it is to "export" a number of functions into the calling package's namespace; so you can call (e.g.)"param" function without prepending "CGI::" to it. The OO interface makes all those functions methods of the query object, and so there's no need to *import* them).

the "uninitialized" problem in line 20 occurs because, evidently, no paramter named "place" is being passed to the script. Have you tried it from the command line (add "place=links" or some such when you run it. CTRL-D will end the input of name-value pairs) The solution to a problem like this is usually something like:

my $val = $query->param('foo') || 'default value';

Second pointer: CGI.pm can handle arrays, as I found out some time ago by asking on this very site. (link to follow => Passing arrays to a CGI read Fastolfe's post ). The basic idea here is that you put any number of fields with the same name in your HTML form, and CGI will return them as an array if you request it as such, i.e.

my @texts = $query->param('text');
will store all the returned fields named 'text' into the array.

HTH for a start.

Philosophy can be made out of anything. Or less -- Jerry A. Fodor


In reply to Re: Problems with scripts by arturo
in thread Problems with scripts by damian1301

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.