in reply to How to cpture output of interactive command using perl.?

Have you tried:
open my $fh, "interactive_command |" or die; # I can never remember t +he mode for the 3-arg form of this while (<$fh>) { ... } close $fh or die;

Replies are listed 'Best First'.
Re^2: How to cpture output of interactive command using perl.?
by Rapunzel (Novice) on Dec 10, 2008 at 10:32 UTC
    Thanks for looking to it. By using this I am able to run the command in interactive mode , but still i am not able to capture the output of the executed command. Please elaborate more on how to cature the output.
      Well, you read the output from the handle. And by output, I mean whatever the program writes to STDOUT. If the program "outputs" by driving the terminal and printing to the terminal, it becomes something different.
      open my $fh, "cat |" or die; while (<$fh>) { print "Got: $_"; } close $fh or die; __END__ foo Got: foo bar Got: bar baz Got: baz ^D