I thought I could do it the way that has been stated below. However when I sort it this way the output is the values in hexadecimal values, instead of the string pointing to "item" in the array @menu. What I want to achieve is to sort it by "item-name"
my @menu = (
{ item => "Blazer", price => 100, color => "Brown" },
{ item => "Jeans", price => 50, color => "Blue" },
{ item => "Shawl", price => 30, color => "Red" },
{ item => "Suit", price => 40, color => "Black" },
{ item => "Top", price => 25, color => "White" },
);
my @test = sort {item } @menu;
foreach (@test){
print $_;
}
perldoc -f sortfirst?