#!/usr/bin/perl -Tw use strict; use CGI qw/:standard *table/; my @products = ( ['Dog', 'Rover', 'Hairy', 'Smelly'], ['Cat', 'Snowball', 'Sharp', 'Smelly'], ['Mouse', 'Mousey', 'Tiny', 'Cheese'] ); print header(), start_html('Product Info'), start_table( {cellpadding=>5,border=>2,align=>'center'} ); for my $product (@products) { print Tr( th( {align=>'left'}, 'Product ID/Name:' ), td( $product->[0] ) ); my $i; for my $entry (@{$product}) { next if ++$i == @{$product}; print Tr( td( '    Entry #', $i, ':' ), td( textfield( {name=>$product->[0].$i,value=>$product->[$i],size=>25} ) ) ); } print Tr( td( {colspan=>2}, p() ) ); } print end_table(), end_html();