From: Mischa POSLAWSKY Date: Tue, 10 Feb 2015 04:26:34 +0000 (+0100) Subject: tools/mkcharinfo: silence warnings in perl 5.18 X-Git-Tag: v1.7~175 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/dd5b69ff6ef39a7b8521bac32f2a1aa8ad327729 tools/mkcharinfo: silence warnings in perl 5.18 --- diff --git a/tools/mkcharinfo b/tools/mkcharinfo index 577ffb1..b673105 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -3,6 +3,7 @@ use 5.010; use strict; use warnings; use utf8; +no if $] >= 5.018, warnings => 'experimental::smartmatch'; use open OUT => ':utf8', ':std'; use Data::Dump 'pp'; @@ -32,7 +33,9 @@ eval { eval { require HTML::Entities; - while (my ($char, $entity) = each %HTML::Entities::char2entity) { + our %char2entity; + HTML::Entities->import('%char2entity'); + while (my ($char, $entity) = each %char2entity) { $entity =~ /[a-zA-Z]/ or next; # only actual aliases $info{$char}->{html} = substr($entity, 1, -1); } @@ -115,7 +118,7 @@ for my $cp (sort keys %info) { say '}'; sub escapeq { - my $_ = shift; + local $_ = shift; return 'undef' if not defined; s/(['\\])/\\$1/g; return "'$_'";