Subject: | ValuesAndExpressions::ProhibitUnknownBackslash doesn't handle utf8 source code |
See this example program:
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
my $who = shift;
print "$who is a 💩\n";
(Note that that symbol is UTF-8 encoding of \N{PILE OF POO})
When I try to tidy this I get:
bash $ perlcritic -s ValuesAndExpressions::ProhibitUnknownBackslash insult.pl
Fatal error while critiquing "insult.pl": Can't call method "child" on an undefined value at /opt/perl5.26.1/lib/site_perl/5.26.1/Perl/Critic/Policy/ValuesAndExpressions/ProhibitUnknownBackslash.pm line 321.
Trace begun at /opt/perl5.26.1/lib/site_perl/5.26.1/Perl/Critic/Command.pm line 258
Perl::Critic::Command::_critique('HASH(0x168ffe0)', 'insult.pl') called at /opt/perl5.26.1/lib/site_perl/5.26.1/Perl/Critic/Command.pm line 64
Perl::Critic::Command::run at /opt/perl5.26.1/bin/perlcritic line 20