in reply to Code review

field (\@GRD, 1, \@GRDF1); field (\@GRD, 2, \@GRDF2); field (\@GRD, 3, \@GRDF3); field (\@GRD, 4, \@GRDF4); field (\@GRD, 5, \@GRDF5); field (\@GRD, 6, \@GRDF6);
When you see lots of calls that look very, very similar it is a sign that the code needs to be rewritten for brevity. If you had changed @GRDF to a list of list references (as in @GRDF = ( [G Y], [B], \@TBLB2 ) \@TBLB3 [S U] \@MONEY )):
for (1..6) { field (\@GRD,$_,$GRDF[$_]); }
You are using slices when you mean to be referring to list elements. You wrote:
sub field { my ($cmd, $num, $fld) = @_; $max = $#$fld; for ($i = 0; $i <= $max; $i++) { if (@$cmd[$num] eq @$fld[$i]) {
But what you meant was:
my ($cmd, $num, $fld_ref) = @_; my $found = 0; #false if ($cmd->[$num] eq "") {$found = 0} else { for (0..$#$fld_ref){ if ($cmd->[$num] eq $fld->[$_]) {$found = 1}; } } if not ($found) {print "ITEM what-cha-ma-calit is not valid ..."};
Because your function is basically looking to see if the element is in the array. There are better, cleaner ways to write this than the above but you were using array references in the function calls so this should be consistent with your original purpose (I think)...

Celebrate Intellectual Diversity