in reply to Re: Function-oriented style CGI accessing form parameters
in thread Function-oriented style CGI accessing form parameters
I assume (dangerous, I know), that I can print the key value pairs with:
while (my ($variable_name, $variable_value ) = each %params) { print "Variable name = $variable_name/n Variable value = $variable +_value\n\n"; }
Yes?
UPDATE
my test/understanding code now looks like this:
I tried#!/usr/bin/perl -wT # tools.cgi use strict; use CGI qw(header start_html Vars pre); use CGI::Carp qw(fatalsToBrowser); print header(); print "These are the values submitted:\n\n"; my %params = Vars(); my $count = keys %params; print $count; while (my ($variable_name, $variable_value ) = each %params) { print "Variable name = $variable_name/n Variable value = $variable +_value\n\n"; }
foreach $sri_variable( $cgi->param){ print "$sri_variable:\n"; foreach $variable_value( $cgi->param($sri_variable) ){ print " $variable_value\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Function-oriented style CGI accessing form parameters
by Your Mother (Archbishop) on Aug 03, 2005 at 20:49 UTC | |
by hmbscully (Scribe) on Aug 03, 2005 at 21:14 UTC |