kudra has asked for the wisdom of the Perl Monks concerning the following question:
Here is a pruned example to demonstrate the problem:
An error in line 2 caused by a problem with the expect command will go to STDERR. An error generated by 'program'--such as will be generated after sending the incorrect password at line 4--will go to STDOUT, not STDERR, which is also where any data resulting from a valid run of 'program' will go.my $object = Expect->spawn("program"); # 1 my $error = ($object->expect(30, 'password:'))[1]; # 2 die "$error\n" if ($error); # 3 print $object "incorrectpassword\r"; # 4 $object->soft_close(); # 5
Is there some way I can separate the output of 'program' based upon the status of 'program'? If there is any mention of such behavior in the Expect docs then it was probably in the section that was too dense for me, so please elaborate instead of pointing me to them, as I have read quite a few times.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jcwren) RE: How to split output using Expect.pm
by jcwren (Prior) on Aug 16, 2000 at 18:59 UTC | |
by tye (Sage) on Aug 17, 2000 at 08:10 UTC | |
|
Re: How to split output using Expect.pm
by merlyn (Sage) on Aug 16, 2000 at 15:37 UTC | |
|
RE: How to split output using Expect.pm
by Adam (Vicar) on Aug 16, 2000 at 21:20 UTC | |
by tilly (Archbishop) on Aug 17, 2000 at 03:26 UTC | |
by Adam (Vicar) on Aug 17, 2000 at 03:35 UTC |