We are using a set of external binaries on Windows to, roughly speaking, control a job management system. For this discussion it is sufficient to know that there exists a bkill.exe, which can be used from the Windows command line to kill a job:

bkill.exe 4711
kills the job with number 4711. If this job has already terminated at the time of killing, we get not surprisingly the message
Job <4711>: Job has already finished

on standard error. Now comes the funny thing: When I call the program from Perl, say with
perl -lwe "system(qq(bkill 4711))"
I get the following answer under ActiveState Perl 5.10:
Job <4711>: Job has already finished Can't spawn "bkill.exe 4711": No error at -e line 1.
Even without knowing anything about the internals of bkill.exe, I wonder why this error is displayed (after all, it obviously *could* spawn bkill.exe), and why this is considered as "No error".

Since I also happen to have Perl 5.7 installed, I tried it with this version too, and here, the output looks even funnier:

Job <4711>: Job has already finished Job <4711>: Job has already finished Can't spawn "cmd.exe": No such file or directory at -e line 1.
This gives some hint: Maybe Perl 5.7 thought too that it could not spawn the process, but maybe - different to 5.10 - retries once until giving up.

The problem does not appear so far with any other program (and also with bkill only in this certain circumstance - for instance, "killing" a job which has never existed, or killing an existing job, does not show any unusual output). Now of course we have no oddities what is going on within bkill - I don't have the source code -, but no matter what it is, how could possibly be Perl tricked into thinking that it could not spawn the process?

-- 
Ronald Fischer <ynnor@mm.st>

In reply to What error is "No Error" by rovf

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.