Perl: Decoder brainfart