mmartin has asked for the wisdom of the Perl Monks concerning the following question:
Hello All,
Perl: 5.14.4
OS: Win32 (XP)
Does anyone know why if I execute a Perl script using Proc::Background I get an error about 'absolute path' if
I don't include the "perl" keyword before the script name?
Both the calling script and the Background Script reside in the same directory. If I run the EXACT same command
using something like backticks or the 'system()' command it runs just fine, but when Proc:Background does it I get
an error. Any ideas?
I ran both the ASSOC and FTYPE commands in the cmd prompt and they are good. I can run the Perl script from the CLI
without any errors, and without needing to add "perl" before the script name, but for some reason Proc::Background
complains when I don't include that...
Now here are some of the things I've tried:
the script name...?
These other methods seem to work without any errors:
Is there something with the Proc::Background command I'm missing?
I don't want to include the "perl" keyword because I'm packaging my Perl Scripts using the CavaPackager Program to
make them into exe's...
I also want to keep them as relative paths since this won't be the final location of the program when I'm completed
everything. And both of those script will ALWAYS be in the same directory.
If anyone has ANY hints or suggestions for me, PLEASE feel free, this is getting very frustrating...
Thanks in Advance,
Matt
Perl: 5.14.4
OS: Win32 (XP)
Does anyone know why if I execute a Perl script using Proc::Background I get an error about 'absolute path' if
I don't include the "perl" keyword before the script name?
Both the calling script and the Background Script reside in the same directory. If I run the EXACT same command
using something like backticks or the 'system()' command it runs just fine, but when Proc:Background does it I get
an error. Any ideas?
I ran both the ASSOC and FTYPE commands in the cmd prompt and they are good. I can run the Perl script from the CLI
without any errors, and without needing to add "perl" before the script name, but for some reason Proc::Background
complains when I don't include that...
I assume those are correct since it works from the Command Prompt without needing to add the "perl" keyword...?>ASSOC .pl .pl=Perl >FTYPE Perl Perl="C:\strawberry\perl\bin\perl.exe" "%1" %*
Now here are some of the things I've tried:
Does anyone know why the Proc::Background command will not run the Perl script without the "perl" keyword before### THIS ONE GIVE AN ERROR: $proc = Proc::Background->new("bg_script.pl $ARG1 $ARG2 $ARG3 $ARG4"); ### ERROR PRINTED: C:\Script_dir\main_script.pl: cannot find absolute location of bg_scri +pt.pl ### IF I INCLUDE THE PATH: $proc = Proc::Background->new("C:\\Script_dir\\bg_script.pl $ARG1 $ARG +2 $ARG3 $ARG4"); ### ERROR PRINTED (*this one is strange): C:\Script_dir\main_script.pl: no executable program located at C:\Scri +pt_dir\bg_script.pl ### THIS ONE WORKS: $proc = Proc::Background->new("perl bg_script.pl $ARG1 $ARG2 $ARG3 $AR +G4");
the script name...?
These other methods seem to work without any errors:
### Backticks --- *THIS ONE WORKS: `bg_script.pl $ARG1 $ARG2 $ARG3 $ARG4` ### system() --- *THIS ALSO WORKS: system("bg_script.pl $ARG1 $ARG2 $ARG3 $ARG4");
Is there something with the Proc::Background command I'm missing?
I don't want to include the "perl" keyword because I'm packaging my Perl Scripts using the CavaPackager Program to
make them into exe's...
I also want to keep them as relative paths since this won't be the final location of the program when I'm completed
everything. And both of those script will ALWAYS be in the same directory.
If anyone has ANY hints or suggestions for me, PLEASE feel free, this is getting very frustrating...
Thanks in Advance,
Matt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using Proc::Background and Win32
by Corion (Patriarch) on Oct 18, 2013 at 17:21 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 17:56 UTC | |
Re: Using Proc::Background and Win32
by dasgar (Priest) on Oct 18, 2013 at 18:03 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 18:56 UTC | |
Re: Using Proc::Background and Win32
by BrowserUk (Patriarch) on Oct 18, 2013 at 18:10 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 19:07 UTC | |
by BrowserUk (Patriarch) on Oct 18, 2013 at 19:22 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 19:44 UTC | |
Re: Using Proc::Background and Win32
by mmartin (Monk) on Oct 18, 2013 at 19:35 UTC | |
by BrowserUk (Patriarch) on Oct 18, 2013 at 19:55 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 21:19 UTC | |
by BrowserUk (Patriarch) on Oct 18, 2013 at 21:36 UTC | |
by mmartin (Monk) on Oct 18, 2013 at 22:02 UTC | |
| |
Re: Using Proc::Background and Win32
by mmartin (Monk) on Oct 24, 2013 at 14:50 UTC |
Back to
Seekers of Perl Wisdom