CONTENTS


Lastmodified 2018-01-26 (金) 17:05:17


FreeBSD 11.1-R perl v5.24.3 でエラー

filejcode.pl_2017

方々サイトを参考に改変したのが上記


jcode.pl

perlのバージョンアップで、jcode.pl がエラーするようになった。

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()?)

同様のエラーは、他のサイトでも起こっているらしく、解決策も紹介されています。

http://icepotato.cocolog-nifty.com/blog/2014/04/jcodepldefinedh.html

有り難い事です。

【解決法】

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;
}

と修正することで、回避出来るとのことです。

filejcode.pl


Total access 8864:本日 1:昨日 0

Counter: 8864, today: 1, yesterday: 0

添付ファイル: filejcode.pl_2017 1092件 [詳細] filejcode.pl 1532件 [詳細]

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2018-01-26 (金) 17:05:17