Hi,
I'm using an array of hashes to hold some data - a simplified example as follows;
my @values;
$values[0]{'name'} = "Bob";
$values[0]{'age'} = 41;
$values[1]{'name'} = "Fred";
$values[1]{'age'} = 25;
...
$values[25]{'name'} = "Joe";
$values[25]{'age'} = 38;
How can I go about sorting the array so that the elements are ordered by 'age'?
thanks,
Pete
I'm using an array of hashes to hold some data - a simplified example as follows;
my @values;
$values[0]{'name'} = "Bob";
$values[0]{'age'} = 41;
$values[1]{'name'} = "Fred";
$values[1]{'age'} = 25;
...
$values[25]{'name'} = "Joe";
$values[25]{'age'} = 38;
How can I go about sorting the array so that the elements are ordered by 'age'?
thanks,
Pete