in reply to Re: Inventory List Sorting Question
in thread Inventory List Sorting Question

I got it sorted, and did something a little different. Is there a benefit to doing it one way over the other? Here's my code:
$lookfor=<STDIN>; chop($lookfor); if ($lookfor =~ /year/i){ for $list_ref1 ( sort { $a->[0] cmp $b->[0] } @inventory ) { print "\t [ @$list_ref1 ],\n"; } } if ($lookfor =~ /make/i){ for $list_ref1 ( sort { $a->[1] cmp $b->[1] } @inventory ) { print "\t [ @$list_ref1 ],\n"; } }