Why isn't Perl's File::GlobMapper exporting globmap?

Posted by justintime on Stack Overflow See other posts from Stack Overflow or by justintime
Published on 2010-04-25T19:10:18Z Indexed on 2010/04/25 23:03 UTC
Read the original article Hit count: 197

Filed under:

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?

© Stack Overflow or respective owner

Related posts about perl