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...
>ASSOC .pl
.pl=Perl
>FTYPE Perl
Perl="C:\strawberry\perl\bin\perl.exe" "%1" %*
I assume those are correct since it works from the Command Prompt without needing to add the "perl" keyword...?
Now here are some of the things I've tried:
### 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");
Does anyone know why the Proc::Background command will not run the Perl script without the "perl" keyword before
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.