in reply to Sorting an array of records
One more comment on style: you are assigning an anonymous hash to a variable to push the hash onto an array. Why not just directly push the anonymous hash onto the array:
It's minor (in this context), I know, but those little bits of memory consumed by things like $h hanging around can add up over the life of a program.my @workers; push @workers, {name => "Herb", salary => 250000, job => "doctor"}; push @workers, {name => "Marge", salary => 400000, job => "ceo"}; push @workers, {name => "Ingmar", salary => 50000, job => "painter"};
|
|---|