Perl: Implement FREEZE/THAW interface in encoder and decoder