in reply to Vexed Otra Vez
As an aside, be inclined to use the CGI.pm module rather than manual html if you're planning on doing more serious CGI work in the future.#!/usr/bin/perl -w use strict; my @skuid=("11021","11022","11023"); my @name=("mt. eden","dom perignon","veuve cliquot"); my @price=("45.99","135.99","79.99"); print "Content-type:text/html\n\n"; print "<html><head><title>Test script</title></head><body>\n"; foreach my $skuid (@skuid) { print "SKUID:$skuid\n"; } foreach my $name (@name) { print "NAME:$name\n"; } foreach my $price (@price){ print "PRICE:$price\n"; } print "</body></html>";
If none of this helps, more information on your platform, perl version (with perl -v), and browser would be helpful.
Update:
I just couldn't help myself... the problem I think you're trying to solve screams for a hash. Here's how I would actually do it (note I'm a big fan of using CGI.pm functionally):
#!/usr/bin/perl -w use strict; use CGI ":standard"; my %wines = (11021 => ["Mt. Eden", "45.99"], 11022 => ["Dom Perignon", "135.99"], 11023 => ["Veuve Cliquot", "49.99"]); print header, start_html({-title=>'Wines'}), table({-border=>1}, [Tr([th(["SKUID", "Name", "Price" ]), map td([$_, $wines{$_}->[0], $wines{$_}->[1]]), sort keys %wines ]) ]), end_html;
|
|---|