File tree 1 file changed +5
-2
lines changed
cpan/Module-Metadata/lib/Module 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,6 @@ sub _parse_fh {
546
546
547
547
while (defined ( my $line = <$fh > )) {
548
548
my $line_num = $. ;
549
-
550
549
chomp ( $line );
551
550
552
551
# From toke.c : any line that begins by "=X", where X is an alphabetic
@@ -685,14 +684,18 @@ sub _evaluate_version_line {
685
684
my $self = shift ;
686
685
my ( $sigil , $variable_name , $line ) = @_ ;
687
686
687
+ # It is not legal to do local on a variable in the local name space before it is declared.
688
+ my $local = ($variable_name =~ m / ::/ ) ? ' local' : ' my' ;
689
+
688
690
# We compile into a local sub because 'use version' would cause
689
691
# compiletime/runtime issues with local()
690
692
$pn ++; # everybody gets their own package
691
693
my $eval = qq{ my \$ dummy = q# Hide from _packages_inside()
692
694
#; package Module::Metadata::_version::p${pn} ;
695
+ no strict 'vars';
693
696
use version;
694
697
sub {
695
- local $sigil$variable_name ;
698
+ $ local $sigil$variable_name ;
696
699
$line ;
697
700
return \$ $variable_name if defined \$ $variable_name ;
698
701
return \$ Module::Metadata::_version::p${pn} ::$variable_name ;
You can’t perform that action at this time.
0 commit comments