jcode.plでdefined(%hash) is deprecated at ../perllib/jcode.pl line 684.のエラー
perlがバージョンアップして5.14になったら
defined(%hash) is deprecated at ../perllib/jcode.pl line 684.
(Maybe you should just omit the defined()?)
defined(%hash) is deprecated at ../perllib/jcode.pl line 693.
(Maybe you should just omit the defined()?)
なるエラーが出るようになった。
defined関数はスカラーに適用されるものなので、ハッシュだとだめらしい。ハッシュが作られているかどうか調べればいいだけなので、682行目からの
sub z2h_euc {
local(*s, $n) = @_;
&init_z2h_euc unless defined %z2h_euc_inited;
$s =~ s/($re_euc_c|$re_euc_kana)/
$z2h_euc{$1} ? ($n++, $z2h_euc{$1}) : $1
/geo;
$n;
}
sub z2h_sjis {
local(*s, $n) = @_;
&init_z2h_sjis unless defined %z2h_sjis_inited;
$s =~ s/($re_sjis_c)/$z2h_sjis{$1} ? ($n++, $z2h_sjis{$1}) : $1/geo;
$n;
}
を次のように修正したら解決。
sub z2h_euc {
local(*s, $n) = @_;
&init_z2h_euc if !%z2h_euc;
$s =~ s/($re_euc_c|$re_euc_kana)/$z2h_euc{$1} ? ($n++, $z2h_euc{$1}) : $1/geo;
$n;
}
sub z2h_sjis {
local(*s, $n) = @_;
&init_z2h_sjis if !%z2h_sjis;
$s =~ s/($re_sjis_c)/$z2h_sjis{$1} ? ($n++, $z2h_sjis{$1}) : $1/geo;
$n;
}
« Postfixで外部にメールが送信できずName service error for...のエラーが出る | トップページ | Javascriptで簡単な塗り絵をしてみた »