Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Two sort in single Array set

by sundialsvc4 (Abbot)
on Aug 30, 2017 at 22:22 UTC ( [id://1198364]=note: print w/replies, xml ) Need Help??


in reply to Two sort in single Array set

This node falls below the community's threshold of quality. You may see it by logging in.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1198364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (None)
    As of 2024-04-25 00:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found