decode関数使ってるところを、from_toに置き換えろってこと

use Encode qw{from_to};
use Encode::Guess qw{euc-jp shiftjis 7bit-jis utf8};