in reply to Sorting an array of records

You're always showing @workers, regardless of show's arguments.

Change
foreach my $workref (@workers)
to
foreach my $workref (@_)

Actually, that can be optimized. You should actually pass an array reference to show instead of a list:

show(\@workers); ... show(\@sort2); ... sub show { my ($array) = @_; foreach my $workref (@$array) { ... } }

I was about to update my node with other inefficiencies, but others have already mentioned them. Avoid copying the hash (%worka = %$a) and have a look at the <=> equality operator.

Replies are listed 'Best First'.
Re^2: Sorting an array of records
by fruitbeeriswrong (Initiate) on Aug 30, 2005 at 18:25 UTC
    Thanks, thats brilliant. If you listen closely you can here the sound of me kicking myself.