From dd5b69ff6ef39a7b8521bac32f2a1aa8ad327729 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 10 Feb 2015 05:26:34 +0100 Subject: [PATCH] tools/mkcharinfo: silence warnings in perl 5.18 --- tools/mkcharinfo | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 "'$_'"; -- 2.30.0