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
In reply to Getting hash of CGI variables by Lori713
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |