Perl 5.8.x で文字コードの自動判別と変換

use Encode qw/from_to/;
use Encode::Guess qw/euc-jp shiftjis 7bit-jis/;

my $data = 'データ';
my $enc  = guess_encoding($data);
my $from = $enc->name;
my $to   = 'euc-jp';

from_to($data, $from, $to);

print $data;


- Encode
  http://perldoc.com/perl5.8.0/lib/Encode.html

- Encode::Guess
  http://www.perldoc.com/perl5.8.0/lib/Encode/Guess.html