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

Replies are listed 'Best First'.
Re: Passing a query string to a sub call
by mirod (Canon) on Apr 01, 2002 at 08:35 UTC

    Do you mean this?

    form( $num); ... sub form { my $game= shift; # if you have several parameters use # my( $p1, $p2)= @_; ... }

    You should seriously consider getting a book if you want to learn Perl: Learning Perl and Elements of Programing with Perl are good choices.

    Update: considering the names of your subs/variables and the other question you asked I would also strongly advise you to use the CGI module and to read its docs, plus Ovid's Web Programing with Perl course. If you are using one of Matt's scripts you might also want to have a lokk at NMS for state of the art replacements

      While mirod has answered your question directly, I would just add perlsub, perlsyn and perlref as references which should help also. This documentation and more is available in the Library and through the perldoc command from your command line or shell prompt.

       

Re: Passing a query string to a sub call
by aersoy (Scribe) on Apr 01, 2002 at 08:45 UTC

    Hello,

    I suggest you to read the documentation for CGI module, as it is nearly the defacto way of doing this (hint: Fetching the names of all parameters passed to your script and Fetching the value or values of a single named parameter).

    (If this is not what you are trying to accomplish, please elaborate.)

    --
    Alper Ersoy