use strict;
use warnings;
use utf8;
+no if $] >= 5.018, warnings => 'experimental::smartmatch';
use open OUT => ':utf8', ':std';
use Data::Dump 'pp';
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);
}
say '}';
sub escapeq {
- my $_ = shift;
+ local $_ = shift;
return 'undef' if not defined;
s/(['\\])/\\$1/g;
return "'$_'";