Lori713 has asked for the wisdom of the Perl Monks concerning the following question:
I've tried the following code to print out my hash list of CGI variables. I'm expecting to see something about the cartoon/sitcom couples I've listed to show up, but I get nothing returned (other than the line "Begin testing area.")
My greater purpose in understanding this snippet is so that I can potentially use it in my program. I'm using HTML::Template, CGI.pm to generate some web pages. From one of the generated web pages, I'd like to click on one of the cells in a table and launch the next .pl file, but carry along with it some of the variables that help define what that cell is (for instance, income account row intersecting with the current month row).
Below is what I have:
I don't know what 'address' refers to, but I typed the example almost exactly as I saw it in the CGI.pm docs (I used $CGI instead of $q since that's what I have in my real program). I also often use Data::Dumper to help me see what's actually in my variables but it also shows nothing (I'm just learning D::D as well).#!/usr/local/bin/perl5_8 use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; my $CGI = new CGI ( { 'fred' => 'ethel', 'ricky' => 'lucy', 'fred' => 'wilma', 'barney' => 'betty' } ); $|=1; print $CGI->header; print "Begin testing area.<br>\n"; my ($params, @foo, %params); $params = $CGI->Vars; print $params->{'address'}; #<--- what is "address"? @foo = split("\0",$params->{'foo'}); %params = $CGI->Vars; print $params->{'address'}; use CGI ':cgi-lib'; $params = Vars;
Any ideas on how to get a list of passed variables? Thanks!
Lori
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting hash of CGI variables
by matthewb (Curate) on Jan 22, 2004 at 20:29 UTC | |
by Lori713 (Pilgrim) on Jan 22, 2004 at 20:52 UTC | |
by revdiablo (Prior) on Jan 22, 2004 at 22:49 UTC | |
|
Re: Getting hash of CGI variables
by davido (Cardinal) on Jan 22, 2004 at 20:31 UTC | |
by Lori713 (Pilgrim) on Jan 22, 2004 at 20:59 UTC | |
by davido (Cardinal) on Jan 22, 2004 at 22:46 UTC | |
|
Re: Getting hash of CGI variables
by jdtoronto (Prior) on Jan 22, 2004 at 20:28 UTC | |
by Lori713 (Pilgrim) on Jan 22, 2004 at 20:46 UTC | |
|
Re: Getting hash of CGI variables
by Zed_Lopez (Chaplain) on Jan 22, 2004 at 20:35 UTC | |
by Lori713 (Pilgrim) on Jan 22, 2004 at 20:43 UTC | |
by Zed_Lopez (Chaplain) on Jan 23, 2004 at 07:56 UTC | |
|
Re: Getting hash of CGI variables
by BUU (Prior) on Jan 23, 2004 at 07:02 UTC | |
by Lori713 (Pilgrim) on Jan 23, 2004 at 13:20 UTC | |
by BUU (Prior) on Jan 23, 2004 at 23:16 UTC |