Decode Funktion in Perl

I missed the decode function from PL/SQL in Perl so I wrote it, the parameters look like this (‘variable’, ‘serach1’, ‘return1’ … ‘serach1’, ‘return1’, ‘default return’);

As expected ‘1’ is decodet to ‘a’, ‘2’ to ‘b’ and the default is ‘X’.

 

Leave a Reply

Your email address will not be published.

13 − 11 =