7 use Thread::Pool::Simple;
9 if (eval { require PPI; 1 }) {
10 plan tests => scalar(@Support::Files::testitems);
12 plan skip_all => "PPI not installed";
15 my @testitems = @Support::Files::testitems;
23 local $^W = 0; # don't care about invalid chars in comments
25 open my $fh, '<:utf8', $file or die $!;
29 my $doc = PPI::Document->new(\$source) or do {
30 print "?: PPI error for file $file: " . PPI::Document::errstr() . "\n";
34 my $stmts = $doc->find(sub { $_[1]->isa('PPI::Token::Quote::Double') || $_[1]->isa('PPI::Token::Quote::Interpolate') });
36 for my $stmt (@{ $stmts || [] }) {
37 my $content = $stmt->content;
39 if ($content =~ /(\$\w+::)\$/) {
40 print "?: @{[ $stmt->content ]} contains $1 \n";
48 my $pool = Thread::Pool::Simple->new(
50 max => Sys::CPU::cpu_count() + 1,
51 do => [ \&test_file ],
55 $pool->add($_) for @testitems;