The following is pretty well copied from the documentation.
use File::GlobMapper qw( globmap );
for my $pair (globmap '<*.tar.gz>' => '<#1.tgz>' )
{
}
And it gives
String found where operator expected at globmapper_test1.pl line 4, near "globmap '<*.tar.gz>'"
(Do you need to predeclare globmap?)
(Using ActivePerl 5.10.0 on Windows)
Side questions – if GlobMapper only exports one function, why is it set so you have to export it explicitly?
It’s a bug in File::GlobMapper. It sets up the
@EXPORT_OKvariable, but doesn’t actually use Exporter.But it gets worse.
globmapdoesn’t return a list of arrayrefs (as claimed in the documentation). It really returns an arrayref of arrayrefs. So you’d really have to write: