git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b733f67
)
tools/mkcharinfo: silence warnings in perl 5.18
author
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 10 Feb 2015 04:26:34 +0000
(
05:26
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 13 Feb 2015 16:43:00 +0000
(17:43 +0100)
tools/mkcharinfo
patch
|
blob
|
history
diff --git
a/tools/mkcharinfo
b/tools/mkcharinfo
index 577ffb17b65cfaaa30640df2754d5bb5796c2475..b673105339f79357b741efc19c8e671eb3b24680 100755
(executable)
--- a/
tools/mkcharinfo
+++ b/
tools/mkcharinfo
@@
-3,6
+3,7
@@
use 5.010;
use strict;
use warnings;
use utf8;
use strict;
use warnings;
use utf8;
+no if $] >= 5.018, warnings => 'experimental::smartmatch';
use open OUT => ':utf8', ':std';
use Data::Dump 'pp';
use open OUT => ':utf8', ':std';
use Data::Dump 'pp';
@@
-32,7
+33,9
@@
eval {
eval {
require HTML::Entities;
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);
}
$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 {
say '}';
sub escapeq {
-
my
$_ = shift;
+
local
$_ = shift;
return 'undef' if not defined;
s/(['\\])/\\$1/g;
return "'$_'";
return 'undef' if not defined;
s/(['\\])/\\$1/g;
return "'$_'";