?item~1~name=boobtube&item~1~qty=1&item~1~code=mysqlpk&item~2~name=loosifer&item~2~qty=1&item~2~code=666&ship~firstname=Han ... #### # Always use warnings; use strict; use CGI; my $q = CGI::new; my %lineitem; my %ship; # process params # for my $param ( $q->param ) { my @id = split(/~/,$param); # a SWITCH would work nicely, but I'll try # not to confuse the example if ( $id[0] eq 'item' ) { $lineitem{$id[1]}{$id[2]} = $q->param($param); } if ( $id[0] eq 'ship' ) { $ship{$id[1]} = $q->param($param); } } # process lineitems # print "Please confirm order of
"; for my $item ( keys %lineitem ) { print $lineitem{$item}{qty}, $lineitem{$item}{name}; print "
"; } print "
being shipped to $ship{firstname}
";