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

test.pm is in \\server1\doc\ and test.pl is in c:\, and it will use some functions in test.pm, is there way to do that? I know package Test; can't work

Replies are listed 'Best First'.
Re: How to include a file which is in a shared folder?
by ikegami (Patriarch) on Jan 19, 2010 at 07:15 UTC
    The fact that it is in a shared folder is of no consequence. As long as the folder is in @INC, shared or otherwise, Perl will look for the module there. Two convenient ways of modifying @INC is through env var PERL5LIB (see perlrun) and via module lib.
    use lib '\\\\server1\\doc'; or use lib '//server1/doc'; use test;

    If you're going to use use, make sure test.pm starts with package test;. Also make sure to use the same capitalisation for the name in both the use and package statements.

Re: How to include a file which is in a shared folder?
by Anonymous Monk on Jan 19, 2010 at 06:45 UTC