Wait, if you've got a use Encode qw(decode); in there, does that mean you're running Wakaba Zero? What Perl version do you have? Zero requires at least 5.8.0.
use Encode qw(decode);