in reply to Command Line Programming

To write to a program use the following:
$pid = open(PROG, "| /path/to/program"); print PROG "input for prog"; close(PROG);

~~rob
____________________________________________________________
eval pack "h*", "072796e647022245d445f475454494c5e622b3";

Replies are listed 'Best First'.
Re: Re: Command Line Programming
by stajich (Chaplain) on Jun 20, 2002 at 17:02 UTC
    And obviously if you wanted cmd line arguments just add them to the exe line below.
    $pid = open(PROG, "| /path/to/program -a v1 -b v2 "); print PROG "input to program\n"; close(PROG);
    See IPC::Open2 and IPC::Open3 for reading from STDOUT, STDERR, and writing to STDIN all for the same application.