diff --git a/lib/File/GlobMapper.pm b/lib/File/GlobMapper.pm index 6454bc4..2332336 100644 --- a/lib/File/GlobMapper.pm +++ b/lib/File/GlobMapper.pm @@ -315,7 +315,6 @@ sub _parseOutputGlob } my $noPreBS = '(?{InputPattern}/ )) { $outFile = $self->{OutputPattern}; my $ix = 1; # get the filename glob - $outFile =~ s/${noPreESC}${BEGIN_DELIM}${END_DELIM}/$inFile/g; + $outFile =~ s/${BEGIN_DELIM}${END_DELIM}/$inFile/g; # now each of the #1, #2,... for my $pattern (@matches) { - $outFile =~ s/${noPreESC}${BEGIN_DELIM}${ix}${END_DELIM}/$pattern/g; + $outFile =~ s/${BEGIN_DELIM}${ix}${END_DELIM}/$pattern/g; ++ $ix; } diff --git a/t/globmapper.t b/t/globmapper.t index 842562f..824466b 100644 --- a/t/globmapper.t +++ b/t/globmapper.t @@ -24,7 +24,7 @@ Perl $]" ) $extra = 1 if eval { require Test::NoWarnings ; Test::NoWarnings->import; 1 }; - plan tests => 76 + $extra ; + plan tests => 80 + $extra ; use_ok('File::GlobMapper') ; } @@ -340,6 +340,24 @@ Perl $]" ) ], " got mapping"; } +{ + title "check wildcard references after ordinary letters"; + + my $tmpDir ;#= 'td'; + my $lex = LexDir->new( $tmpDir ); + + touch map { "$tmpDir/$_.tmp" } qw( abc ) ; + + my $map = File::GlobMapper::globmap("$tmpDir/a*.tmp", "$tmpDir/B#1.out"); + ok $map, " got map" + or diag $File::GlobMapper::Error ; + + is @{ $map }, 1, " returned 1 map"; + is_deeply $map, + [ [map { "$tmpDir/$_" } ("abc.tmp", "Bbc.out")], + ], " got mapping"; +} + # TODO # test each of the wildcard metacharacters can be mapped to the output filename #