Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: 'reversing' a hash

by thealienz1 (Pilgrim)
on Jun 18, 2003 at 17:07 UTC ( [id://266905]=note: print w/replies, xml ) Need Help??


in reply to 'reversing' a hash

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

Replies are listed 'Best First'.
Re: Re: 'reversing' a hash
by Tomte (Priest) on Jun 18, 2003 at 17:13 UTC

    use Data::Dumper; %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=> +4); %ERRORS_TEXT = reverse %ERRORS; print Dumper(\%ERRORS); print Dumper(\%ERRORS_TEXT); __END__ $VAR1 = { 'WARNING' => 1, 'CRITICAL' => 2, 'OK' => 0, 'DEPENDENT' => 4, 'UNKNOWN' => 3 }; $VAR1 = { '1' => 'WARNING', '4' => 'DEPENDENT', '0' => 'OK', '3' => 'UNKNOWN', '2' => 'CRITICAL' };

    Get it?
    I use this to refer to the cleartext-error-code I get as exit-status of a sub-process.

    regards,
    tomte


    Hlade's Law:

    If you have a difficult task, give it to a lazy person --
    they will find an easier way to do it.

      Got it...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found