Windows 2008 Perl[cygwin installed in it] ----------------------- I have a user defined module existing in /opt/mailh/sys/ which invokes a function within Process.pm which exists in /opt/syn/Win32/Process.pm.Though I include the "/opt/syn/Win32/Process.pm" in the @INC variable[I print it to verify it as well], the user defined module says "Undefined subroutine" .So I copy the Process.pm to the local directory in which user defined module exists and now it works fine.So why is this not searching from the @INC directory ?Please reply.
Windows 2008 Perl[cygwin installed in it] ----------------------- I have a user defined module existing in /opt/mailh/sys/ which invokes a function within Process.pm which exists in /opt/syn/Win32/Process.pm.Though I include the "/opt/syn/Win32/Process.pm" in the @INC variable[I print it to verify it as well], the user defined module says "Undefined subroutine" .So I copy the Process.pm to the local directory in which user defined module exists and now it works fine.So why is this not searching from the @INC directory ?Please reply.
You need to add the directory where your module is to @INC. Use the lib pragma to do so.
Code
use lib '/opt/syn/Win32';
use Process;
See `perldoc lib` for details.
__END__
I love Perl; it's the only language where you can bless your thingy.
Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.
Get Markup Help. Please note the markup tag of "code".
As shown above, you add the folder where the module is, not the folder and the module name to @INC, just the folder. -------------------------------------------------