Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

From the OP, IPC::Run3::run3 does not seem to work, I have included a working example below. (ActivePerl 5.10.1, IPC::Run 0.043) This will run the program in batch mode, which may or not work, or be what you want in your case.

use strict; use warnings; use IPC::Run3; my (@fromme, @tome); ## Setup my input... push @fromme, "3*12\n"; push @fromme, "40*4\n"; ## Do it; running CLI calculator, but could be anything unless (run3( "bc.exe", \@fromme, \@tome, \@tome )) { ## STDIN STDOUT STDERR ...for the program print "ERROR in command\n"; } print "Return code = $?\n"; ## Return output while ($_ = shift @tome) { print "$_"; } __END__ ~~Output~~ Return code = 0 36 160

Maybe update your post with more detail of what you wish to do.

Good luck. -c


In reply to Re: Automating user input for a CLI-based program on windows by chuckbutler
in thread Automating user input for a CLI-based program on windows by nilesh27602816

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found