in reply to •Re: Can I include a package as part of my script?
in thread Can I include a package as part of my script?

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
  • Comment on Re: •Re: Can I include a package as part of my script?

Replies are listed 'Best First'.
•Re: Re: •Re: Can I include a package as part of my script?
by merlyn (Sage) on Apr 29, 2003 at 02:53 UTC
Re: Re: •Re: Can I include a package as part of my script?
by hawtin (Prior) on Apr 29, 2003 at 07:37 UTC

    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.