The lib pragma expects a directory path as its arg without the filename. And based on the module code you posted, even if you remove the filename from that statement, it still couldn't import the $var variable since it doesn't exist.

Your module code is even missing the package declaration, so it's not a true module. It is a library file/script.

Here's how to do it without using Exporter to export $VERSION

Code

package FileLocking;

use strict; use warnings;

our $VERSION = '0.004002';

1;

Code

#!/usr/bin/perl

use strict; use warnings; use lib '/usr/software/test/share/perl5.14_temp/lib/perl5/Lucy/Docs'; use FileLocking;