xaos has asked for the wisdom of the Perl Monks concerning the following question:

Hello, i have a short question regarding perl.
i get this message when i use a certain perl script:
:filetest" is not exported by the Lib::File module
the corresponding code is this:
use Lib::File qw (flock_fopen :filetest);
system is perl 5.8.3 on a sles9, there is a file filetest.pm in /usr/lib/perl...

Has someone an idea what this could be?
xaos

Replies are listed 'Best First'.
Re: :filetest not exported by File::Lib
by davorg (Chancellor) on Jul 03, 2006 at 10:17 UTC

    Neither File::Lib nor Lib::File (and you use both names so it's impossible to know which one you really mean) are on the CPAN so it's hard to be much help as we can't see the code of the module in question. Where did this module come from?

    An export tag like :filetest is usually created using the Exporter module and the @EXPORT_TAGS variable. You might like to look at the documentation for Exporter to see how it's supposed to work and then compare that with how your module works.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: :filetest not exported by File::Lib
by imp (Priest) on Jul 03, 2006 at 12:44 UTC
    The problem is that the Lib::File module apparently does not support the export the tag ':filetest'.

    I could not find the module on CPAN, but google found this:
    http://www.lackas.net/imp/docs/Lib/File.html

    Unfortunately I don't see the code listed, so I cannot check what the module exports. You can though. Find this file (Lib/File.pm) and look through the source to see whether it uses the Exporter module to control what tokens it exports. If so, look for %EXPORT_TAGS.

    You should also search for 'sub import', which would be custom import behaviour.

    Perhaps you meant to do this: use filetest;
    The filetest module is listed as "Perl pragma to control the filetest permission operators".
    Read perldoc filetest for more information.

Re: :filetest not exported by File::Lib
by madtoperl (Hermit) on Jul 03, 2006 at 12:44 UTC