@array has no value from cgi.pm STDIN
am 06.11.2007 21:54:24 von Robert ValcourtGreetings,
I have a Website form with 4 checkboxes each with the same name but
different values. I use cgi.pm to build an @array from these values but it
doesn't seem to be working. The script:
#!/usr/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use strict;
my @services = param('service');
foreach my $choice (@services) {
$choice = "$choice
";
}
print "Content-type: text/html \n\n";
print @services;
exit;
The result is an empty page. The page should have up to 4 lines of text with
the values of the checkboxes as seen below.
Here is what is odd, I use this same exact script for another website that
is on the same server, accesses the same perl library and it works just
fine. The only difference if the site that works has a doctype of 4.01
transitional and is .html and the one that doesn't work doctype xhtml 1.0
and is .php. I wonder if this is an issue. The form:
I "could" name each of the checkboxes different but i'd like to make this
work if possible as does my other script. For what it is worth I have also
tried:
use CGI;
my $q = new CGI;
my @services = $q->param('service');
As described from post:
http://groups.google.ca/group/comp.lang.perl.misc/browse_thr ead/thread/c6fdb07ada986311/75482491e9e6a6fa
CGI.pm is supposed to handle this right? I'm really scratching my head on
this one and its starting to hurt.
TIA
Robert