in reply to Local library for module test script

use lib ".";

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

update

see FindBin, it's core.

use FindBin qw($Bin); use lib "$Bin";

or

use FindBin qw($Bin); require $Bin.'/lib.pm';

Replies are listed 'Best First'.
Re^2: Local library for module test script
by Anonymous Monk on Dec 03, 2014 at 03:59 UTC
    LanX :) a relative path is relative, with cwd() usually being dist-name-version, and the "module.pm" living in dist-name-version/t/ adding "." wouldn't change anything , require lib.pm would still fail
      Anonymous Monk, I tested  use lib '.'!

      (at least I thought :)

      I supposed that lib takes the file's path as base.

      The perldoc wasn't clear¹, so I tested by changing the working directory with chdir before use and it seemed to work fine.

      But now I am realizing that I should have put the chdir into a BEGIN block, otherwise it happens too late.

      So your point is valid!!!

      Cheers Rolf

      (addicted to the Perl Programming Language and ☆☆☆☆ :)

      ¹) but led me now to FindBin