Hi,
I have a Hash:
I want to sort the hash according to sorting of 'roll_no' ..
After sorting It should be displayed
Can anybody help me...
I have a Hash:
Code:
%hash= 'student' => [
{
'roll_no' => 10,
'sub' => 'eng'
marks => 32,
},
{
'roll_no' => 11,
'sub' => 'math'
marks => 69,
},
{
'roll_no' => 10
'sub' => 'science'
marks => 69,
},
{
'roll_no' => 25
'sub' => 'geo'
marks => 59
},
],
I want to sort the hash according to sorting of 'roll_no' ..
After sorting It should be displayed
Code:
%hash= 'student' => [
{
'roll_no' => 10,
'sub' => 'eng'
marks => 32,
},
{
'roll_no' => 10
'sub' => 'science'
marks => 69,
},
{
'roll_no' => 11,
'sub' => 'math'
marks => 69,
},
{
'roll_no' => 25
'sub' => 'geo'
marks => 59
},
],
Comment