in reply to making a hash from cgi parameters
This will work if the input came in from STDIN or via a webserver.#!/usr/bin/perl -w use strict; #Trust us use CGI; my $query = CGI::new; my %data = $query->Vars();
(Note: Masem above uses the same function in a scalar context to get a reference ($data). Used in a list context, Vars() will return a hash, which is what you asked for. Masem's solution is better if you intend to pass the data to subroutines, they work equally well if you treat them as global variables.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use CGI
by Anonymous Monk on May 24, 2001 at 23:39 UTC | |
by swiftone (Curate) on May 25, 2001 at 00:03 UTC | |
by Anonymous Monk on May 25, 2001 at 00:06 UTC | |
by Ovid (Cardinal) on May 25, 2001 at 01:50 UTC | |
by swiftone (Curate) on May 25, 2001 at 02:03 UTC |