今日もやっつけ仕事

use strict;
use warnings;

use DBI;
use Encode qw/from_to/;

my $dbh = DBI->connect('dbi:SQLite:./hash.db', '', '', {RaiseError => 1}) or die $!;
my $sth = $dbh->prepare('SELECT * FROM hash');
$sth->execute;

open my $fh, '>', 'dump.txt' or die $!;
print $fh "hash, name\n";
while (my ($hash, $name) = $sth->fetchrow_array) {
    from_to($name, 'UTF-8', 'CP932');
    print $fh "$hash, $name\n";
}
close $fh;

$sth->finish;
undef $sth; # DBD::SQLite 1.13 bug

$dbh->disconnect;