in reply to Two sort in single Array set

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^2: Two sort in single Array set
by kcott (Archbishop) on Aug 31, 2017 at 05:48 UTC
    "(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

Re^2: Two sort in single Array set
by eyepopslikeamosquito (Archbishop) on Aug 31, 2017 at 22:39 UTC