in reply to Creating vars from URI and printing %ENV
Additionally, multiple parameters with the same name are permissable with CGI queries, but excluded by your code (by the unless $$key conditional).
An alternate method to perform something similar would be to use the code below that will result in passed values being stored in a hash indexed by the parameter name:
my $cgi = CGI->new; my %param = map { $_ => $cgi->param($_) } $cgi->param();
This code allows you to perform similar variable assignment without the use of symbolic references.
Also, strongly consider use strict and -w.
Update : The advice of crazyinsomniac below with regard to $cgi->Vars is by far the better option to the map code above.
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(crazyinsomniac) Re^2: Creating vars from URI and printing %ENV
by crazyinsomniac (Prior) on Dec 28, 2001 at 16:32 UTC | |
by Ovid (Cardinal) on Dec 28, 2001 at 23:10 UTC | |
by chromatic (Archbishop) on Dec 30, 2001 at 08:55 UTC |