#!/usr/bin/perl open my $fh, "<:encoding(euc-jp)", 'kanjidic'; binmode STDOUT, ':utf8'; while (<$fh>) { if (/^(\p{InCJKUnifiedIdeographs})/) { print "Your kanji is '$1'.\n"; } } close $fh;