in reply to Getting arguments such as ?page=20 for web scripts

Read the CGI docs. That is a good beginning.

C-.

  • Comment on Re: Getting arguments such as ?page=20 for web scripts

Replies are listed 'Best First'.
Re: Re: Getting arguments such as ?page=20 for web scripts
by Monolith-0 (Beadle) on Jan 08, 2002 at 22:55 UTC
    The CGI module does many things. What is it that I am looking for?

    - Monolith

      CGI.pm has a method, param(), which when called with no arguments, returns a list of CGI parameters. When called with one of the parameters as an argument, param() returns its value. The following scriptlet gets its parameters and prints their values, in quotes.

      use CGI; my $q = new CGI; # so the output won't be interpreted as HTML print $q->header('text/plain'); print "$_ = '", $q->param($_), "'\n" for $q->params;

      Update: Oops! left out the second call to param()!

      dmm

      You can give a man a fish and feed him for a day ...
      Or, you can
      teach him to fish and feed him for a lifetime