Does it work if you specify the absolute path to the shell (e.g. via COMSPEC)?  I.e.

system "$ENV{COMSPEC} /C $command $arg1 $arg2 $arg3 > $outfile";

 

Update: Presumably, the directory in which cmd.exe resides (typically C:\WINDOWS\system32) isn't on your PATH.

In case of doubt, you might want to print out those variables' content:

set path set comspec

(COMSPEC is not guaranteed to hold the correct path to your command shell — after all, it's just an environment variable. By default, it should, however. At least, it's worth a try. (Perl doesn't use COMSPEC for this very reason of being unreliable.)   In case it doesn't hold the correct path, you could also try directly specifying system = "c:\\windows\\system32\\cmd.exe /c ...", after having verified that it in fact exists...)

Update2: Then again, it might also be some variation of this weird issue... (not sure though).


In reply to Re: System call doesn't recognise '>' by almut
in thread System call doesn't recognise '>' by Lauras

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.