Subject: | "use" inside an "eval" w/o a semi-colon fails |
I've attached a test file that shows a problem with parsing a "use" inside an "eval". If the eval includes a semi colon as part of its statement, then it comes out okay, if not it fails.
e.g.
eval "use Test::Pod 1.00;"; # pass
eval "use Test::Pod 1.00"; # fail
use Test::More tests => 2;
use strict;
use warnings;
use Module::ExtractUse;
my $semi = 'eval "use Test::Pod 1.00;";';
my $nosemi = 'eval "use Test::Pod 1.00";';
my $p = Module::ExtractUse->new;
$p->extract_use( \$semi );
ok( $p->used( 'Test::Pod' ) );
$p = Module::ExtractUse->new;
$p->extract_use( \$nosemi );
ok( $p->used( 'Test::Pod' ) );