##
I0=nameofplant Q0=\d+ P0=\d+\.[\d]{2} IT0=\d+\.[\d]{2}
I1=anotherplant Q1=\d+ P1=\d+\.[\d]{2} IT1=\d+\.[\d]{2}
etc...
####
my $query = CGI->new();
@names = $query->param;
...
NAMES: for $name (@names) {
$values = $query->param( $name );
if ( $flag == 0 ) { #set the first time thru for special purpose data
&checkacct(); # which is formatted differently than the rest...
next NAMES;
} else {
&untaint( $name, $values );
&tohtml( $name, $values );
}
}
####
if ( $name =~ /^I\d+$/ && $values =~ /[A-Za-z\s_\'\-\.]+/ ) { #I\d+
print "\n" . $name . " " . $values . "<\/td>\n"; # start new row
next;
} elsif ( $values =~ /^[\d]+$/ && $name =~ /^Q\d+$/ ) { # Q0,Q1
print " Quant: " . $values . " \n";
next;
# plus 4 more for P\d+ and IT\d+ cases and another pair of special cases
####
"ID: " . $name . " $values "; #(where the inner loop is at [0])
" Quantity: " . $values[1];