in reply to sort keys question

This can also be found in the cookbook, recipe 5.9:
foreach my $invnumctr (sort { $inv{$a} <=> $inv{$b} } keys %inv) { print "$invnumctr is $inv{$invnumctr}\n"; }
It's really quite simple, keys returns the list of keys, and sort takes that list and orders it (via a quick sort) based upon it's argument, an arbitrary code block. $a and $b are special variables that are used by sort, which is a good reason not to use them for other variables in your code.

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--