in reply to Re: Including my own modules
in thread Including my own modules

Thank you guys for the quick replies. I always do "use strict" but hardly ever "use warnings", so I will start using it as well.

I was using the lib as well but I thought that it was not very elegant solution. What is your advice for when you create a distribution that is installed by other users? By then the modules will live where perl can find them and the lib statement is no longer needed.

Should I use lib /my/svn/work/dir while in development and remove it afterwards?

what are the best practices?

Once again thank you in advance for all your wisdom.

Replies are listed 'Best First'.
Re^3: Including my own modules
by almut (Canon) on Dec 17, 2009 at 15:27 UTC

    By then the modules will live where perl can find them and the lib statement is no longer needed.

    Should I use lib /my/svn/work/dir while in development and remove it afterwards?

    In this case you could also set the environment variable PERL5LIB to tell Perl about the additional lib directory in the development environment. This way you wouldn't need any use lib statement at all...

Re^3: Including my own modules
by Anonymous Monk on Dec 17, 2009 at 14:44 UTC
    The general idea is

    dev.pl

    use lib '/my/svn/work/dir'; use MySweetApp; MySweetApp->run();
    prod.pl
    use lib '/production/dir'; use MySweetApp; MySweetApp->run();
    cust.pl
    use lib '/production/dir'; use MySweetApp; MySweetApp->new('notdefault.config')->run();