This is rather embarassing, but I am baffled.

I'm writing a rather simple script to query a database, retrieve a couple of facts, and then iteratively launch another script using those facts as command line parameters.

NB This is all in a Win2000 environment. ActivePerl 5.8.

No biggie, right?

I can launch ordinary exe files (notepad.exe, calc.exe etc), however, try as I might I cannot launch a perl script.

I have tried the following command lines
script.pl arg1, ... argn Drive:\path\script.pl arg1, ... argn Drive:\path\perl.exe Drive:\path\script.pl arg1, ... argn
I've used them as both strings and arrays
i.e.
$cmd = "script.pl arg1, ... argn";
and
@cmd = ("script.pl", arg1, etc, argn);
Ive submitted them as
system( $cmd ); system( @cmd ); use Win32::Process; Win32::Process::Create($process, "C:\\Perl\\bin\perl.exe", here I put any/all command lines above, 0, CREATE_NEW_CONSOLE, ".") || die "Create: $!";
and also
Win32::Process::Create($process, "Drive:\path\script.pl", "arg1, ... argn", 0, CREATE_NEW_CONSOLE, ".") || die "Create: $!";
The system command returns:
'0' is not recognized as an internal or external command
(as do backticks)
The Process::Create returns a variety of:
Create: No such file or directory at scriptname.pl line nn.
I am frankly baffled. There must be something obvious that I'm missing, but I'm running out of guesses.

Does anybody have a clue?

Janitored by Arunbear - added code tags, as per Monastery guidelines


In reply to launching perl processes from a perl script on Win2K by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.