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

I've changed this question from "where is it" to how to use it.

I've downloaded the package and unzipped it. I thought:

pushd(@INC,`cd`);

would include the package from a local directory and then I could use it. But it doesn't.

(Original content below, restored by Arunbear)

Does anyone have a copy of the Win32::Daemon package I can use to install. I can't seem to get a copy from Roth.net, either because my company's system are so restrictive or it just isn't there anymore.

Any other suggestions welcome. I'm gonna try and download it via linux tonight also.

>:-/

ACTUALLY DON'T WORRY ABOUT IT, I GOT IT. STRAIGHT AFTER I WROTE THIS.

Replies are listed 'Best First'.
Re: Win32::Daemon et al
by cdarke (Prior) on Sep 10, 2009 at 09:03 UTC
    pushd is a shell command, it does not exist in Perl (although there may be a module which does it).
    @INC is a Perl variable, it does not exist in the shell. You cannot mix the two.

    If you wish to use a module from the user's home directory which, considering your use of a bare `cd`, is what you are trying to do, then:
    use lib $ENV{'HOME'};

    Update: Hangon! The title of this question is Win32::Daemon. My comments still apply (for 'shell' read 'cmd.exe') except that the HOME environment variable probably will not exist.
      Thanks. pushd was a typo because I keep pushd'ing everywhere in Windows. I was using push though so I'll go with your suggestion. Ta.
Re: Win32::Daemon et al
by desemondo (Hermit) on Sep 10, 2009 at 11:55 UTC
    Ideally you should install the module properly, using Make, or ppm.

    But below is a dodgey hack to use a module, if you're not in a position to install it properly

    Assuming your module is sitting on your desktop, create a folder named "Win32", then place the daemon.pm file inside it.

    Then add this to your test script:
    BEGIN { push @INC, 'C:/documents and settings/user/desktop'; } ### and later use Win32::Daemon; # etc etc # etc
    Update Just noticed that if your current location was the desktop, Perl conveniently searches it for the module you're trying to use. i.e. You only need to add the path of the module to @INC if you're going to call the script from another location. Eg.  C:\temp>
      There was some compatibility issue with the module so I went with SRVANY.exe. Set it all up and nothing seems to be working when the service is running. Bloody Windoze!!! I'll work it out.

      Thanks guys.

Re: Win32::Daemon et al
by Anonymous Monk on Sep 10, 2009 at 07:11 UTC