in reply to Using Proc::Background and Win32

From looking at the source, and the location of the error message, it seems that Proc::Background makes the error of checking $ENV{PATH} for the program, but fails to know that the current directory on Windows is implied to be on the path.

Maybe you can check whether prefixing your Perl script with the current directory works?

$proc = Proc::Background->new("./bg_script.pl $ARG1 $ARG2 $ARG3 $ARG4" +);
or
$proc = Proc::Background->new(".\\bg_script.pl $ARG1 $ARG2 $ARG3 $ARG4 +");

Replies are listed 'Best First'.
Re^2: Using Proc::Background and Win32
by mmartin (Monk) on Oct 18, 2013 at 17:56 UTC
    Hey Corion, thanks for the quick reply!

    Yea, I actually had that there first since I started writing the script on Linux but still got an error...

    # $proc = Proc::Background->new(".\\bg_script.pl $ARG1 $ARG2 $ARG3 $AR +G4"); C:\Script_dir\main_script.pl: cannot find absolute location of .\bg_sc +ript.pl

    Would it be worth it to add my Scripts Directory to the Path variable or something like that?


    Thanks Again,
    Matt