Hi, Weird situation. I'm using a BMC monitoring program that allows me to call an external program and pipe it's output as a variable back into the BMC app. The problem is that it won't run a perl script. It only recognizes .bat files (as far as I can tell). So my question is: How can I run a .bat file that calls a perl script that outputs backs to the .bat file that outputs to the BMC app? Here's what I've got so far:
@echo off call "D:\Program Files\Perl\bin\perl.exe" bayes.pl testArgs #bayes.pl will return the output on the screen #I need to pipe that output back into the .bat file and then I've got +it from there echo BAYESOUTPUT; >> %1
So how do I get what the perl script outputs back into .bat file as an argument/variable? Thanks

In reply to Pipe perl to .bat by theneil

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.