in reply to Can I include a package as part of my script?

See "No excuses about not using CGI.pm".

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: Can I include a package as part of my script?

Replies are listed 'Best First'.
Re: •Re: Can I include a package as part of my script?
by Anonymous Monk on Apr 28, 2003 at 23:20 UTC
    thank you very much. Unfortunatelly Win32::Daemon seems a little more complicated in loading than CGI, and fails with: Can't locate loadable object for module Win32::Daemon in @INC (@INC contains: D:/Perl/lib D:/Perl/site/lib .) at D:/Perl /lib/DynaLoader.pm line 108 btw all that my code does is update password for some services. Chris

      One trick that I've used in the past is to modify @INC to also point to a directory I can modify (e.g. lib in my software release) and then require the module:

      my $dir = Cwd::getcwd() . "/" . $0; $dir =~ s#([/\\])[^/\\]+$#/lib#; push(@INC,$dir); require PrivateModule;

      That way you are only affecting your own script and you can use the standard module.