theneil has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: Pipe perl to .bat
by BrowserUk (Patriarch) on Aug 20, 2012 at 21:04 UTC

    If you have ActiveState perl, look in your Perl\bin directory for pl2bat.bat


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re: Pipe perl to .bat
by Anonymous Monk on Aug 21, 2012 at 07:02 UTC

    need to pipe that output back into the .bat file and then I've got it from there

    Huh?

    $ cat shama.bat @echo off @perl -le " print for 2, 4, 6, 8; " $ call shama.bat 2 4 6 8 $ cat shecko.bat @echo off @perl -ne " print qq[# shecko # $_]; " $ call shama.bat | call shecko.bat # shecko # 2 # shecko # 4 # shecko # 6 # shecko # 8