2017-02-14から1日間の記事一覧

WWW::Mechanize とりあえず完成!

use strict; use warnings; use WWW::Mechanize; use HTML::TreeBuilder; use utf8; use Encode; binmode STDOUT, ':utf8'; sub say {print @_, "\n";} open(IN, '<:encoding(utf8)', 'word_list.txt'); open(OUT, ">word_list_output.txt"); while(<IN>){ chomp; my ($word) = split(/,/, $_); #split リストコン</in></:encoding(utf8)',>…

ファイル入力用のutf8 設定 と リテラル設定

use utf8; binmode STDOUT, ':utf8'; #出口用の追加設定 open my $fh, '<:encoding(utf8)', 'data.txt' #入り口用設定 or die "failed to open file: $!"; my $text = <$fh>; my @text = split //, $text; for (@text) { say $_; } close $fh; ########################################################## use utf8; binmode STDOUT, ':u…</:encoding(utf8)',>