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.
|