my %parhash; for my $i (@data) { chomp $i; my @params = split( /\&/, $i ); # and while you're at it, the "nameX=valueX" can be # stored in a hash like this: for ( @params ) { next unless ( /.=./ ); # make sure there's a name and a value my ($k,$v) = split(/=/); $parhash{$k} = $v; } } # print html header stuff, then: print "user supplied data was:
\n"; for ( sort keys %parhash ) { print "$_ = $parhash{$_}
\n"; } # print html trailer stuff