Hi! I thought the following script:
#!/usr/bin/perl -T use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI; my $parameters = $cgi->Vars(); get_params($parameters);
sub get_params() { my %parameters = %{ $_ };
print $cgi->header(); print $cgi->start_html; my $p; foreach $p (sort keys(%parameters)) { print "key: $p value: $parameters{$p}\n"; } print $cgi->end_html; }
exit(0);
when accessed like this: http://example.com/cgi-bin/viewparams.pl?param1=7¶m2=11
should print
key: param1 value: 7 key: param2 value: 11
but instead it says: "Software error: Can't use an undefined value as a HASH reference at viewparams.pl line 26."
Why?
Thanks, Kiarra
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>