in reply to Re: Two sort in single Array set
in thread Two sort in single Array set

"(Hope I wrote that right ...)"

Instead of hoping, why not actually check your work. This took me just a few seconds:

$ perl -MO=Deparse -e ' sub sort_comp { my $result = ($a->{severity} <=> $b->{severity}; if ($result == 0) { # severity is the same -- dig deeper if ($a->{severity} eq 'critical'} { $result = ($a->{event_age} <=> $b->{event_age}); #asc } else { $result = ($b->{event_age} <=> $a->{event_age}); #desc } } return $result; } ' syntax error at -e line 3, near "};" syntax error at -e line 5, near "critical}" syntax error at -e line 7, near "} else" Unmatched right curly bracket at -e line 12, at end of line -e had compilation errors.

After you've fixed your code, please ensure you follow the "How do I change/delete my post?" guidelines when correcting your what you wrote.

— Ken