in reply to 2 dimensional array sorting...

try an array of hashes:
my @config = [ { number => 0, name => corkscrews }, { number => 0, name => openers } ]; sub sort_products { sort { $a->{number} <=> $b->{number} or $a->{name} cmp $b->{name} } @_; }
the reason for avoiding the array of array solutions is that an array of arrays doesn't say anything about the data, and in fact implies some kind of grid structure, which isn't what you have.