Hi bill5262,

I'm going to guess that by "the windows cmd tool" you don't mean you want a cmd.exe window to open, but instead you want to issue commands from your Perl script which you otherwise would have typed into the command line. The AM already mentioned two good modules, to add to that there's also IPC::System::Simple, and I mention a few more in one of my posts: Re: Using IPC::Open3 instead of backtick operator (updated)

If any of the programs you're running are interactive, meaning they show a prompt of their own and expect you to input something, then the first thing to check is if they also offer a "batch mode" where they accept a command script. Otherwise, you may have to try talking to the program interactively from your Perl script via IPC::Run or Expect (disclaimer: I don't have any experience with these in Windows).

If the programs you're running are not interactive, meaning they just accept arguments on the command line and then run without user input, you can use any of the modules from the first paragraph above. I might suggest IPC::System::Simple because it has the best error reporting of those modules. If you need to capture the program's output and find that IPC::System::Simple is not capturing everything (that's because it doesn't capture STDERR), I'd recommend IPC::Run3.

Hope this helps,
-- Hauke D


In reply to Re: [Newbie Question] How to call cmd line within PERL? by haukex
in thread [Newbie Question] How to call cmd line within PERL? by bill5262

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.