use utf8;
use open ':utf8';
binmode(STDIN => ':raw');
binmode(STDOUT => ':encoding(Shift_JIS)');
use CGI qw(-utf8 :cgi);

my $cgi = CGI->new;
my $query = $cgi->param('query');