in reply to making a hash from cgi parameters
Or:
use CGI qw(:standard); my %data = map { $_ => param ($_) } param();
The second line gets you the same result as
my %data; foreach my $param ( param() ) { $data{$param}= param($param); }
A call to param() (a function in the CGI module) in a list context gets you the name of all the parameters passed to the script via POST and GET. param("name") gets you the value of the passed "name" parameter.
HTH.
perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re(2): use CGI
by Ovid (Cardinal) on May 24, 2001 at 23:09 UTC | |
|
Re: Re: use CGI
by Anonymous Monk on May 24, 2001 at 23:05 UTC |