#!/usr/bin/perl use strict; use warnings; { package MyEnc; use base qw( Encode::Encoding ); __PACKAGE__->Define(qw( japhy )); sub encode { my ($self, $str, $chk) = @_; $_[1] = '' if $chk; $str =~ s/^/> /mg; return $str; } sub decode { my ($self, $str, $chk) = @_; $_[1] = '' if $chk; $str =~ s/^< //mg; return $str; } } open my($in), "<:encoding(japhy)", "input" or die $!; open my($out), ">:encoding(japhy)", "output" or die $!; print $out $_ while <$in>;