in reply to Howto set path for local package in a Perl code

use lib "home/neversaint/MyPerl/src/mypackage.pm";

That's almost certainly wrong. The path should probably start with a '/'. And use lib only contains paths to library directories. You need a separate use statement to actually load the module.

use lib '/home/neversaint/MyPerl/src/'; use mypackage;

(And, as holli says, you shouldn't give a module a lower case name)

Alternatively, you might look at the FindBin module.

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

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

Replies are listed 'Best First'.
Re^2: Howto set path for local package in a Perl code
by chibiryuu (Beadle) on Jun 02, 2006 at 16:32 UTC
    Example: Use FindBin and your script will work no matter where you move it and its modules together.
    use FindBin; use lib "$FindBin::Bin"; use MyPackage;
    use lib only adds the path to @INC, you still need to use MyPackage after it.