in reply to Re: Modifying STDOUT and keeping control
in thread Modifying STDOUT and keeping control
Locks up before it gets to the login prompt....open(PIPE, "telnet 192.168.1.1 |") or die $!; while (<PIPE>) { $bah = $_; $bah =~ s/192.168.1.1//; print $bah; } close(PIPE); bash~$ perl test.pl Trying ... Connected to . Escape character is '^]'.
Does the same thing in the same place, with the exception of printing the pid.use IPC::Open2; print open2(\*IN, \*OUT, "telnet 10.65.2.252"); print OUT "Trying\n"; while (<IN>) { $_ =~ s/10.65.2.252//; print; } close IN; close OUT; bash~$ perl test1.pl 26210Trying ... Connected to . Escape character is '^]'.
Am I misunderstanding what can and can't be done here?
All I need to do is just strip off that ip address, or the whole "trying" message, during execution.( these snips do that, but hang up in the same place ).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Modifying STDOUT and keeping control
by iburrell (Chaplain) on Oct 14, 2002 at 23:27 UTC | |
|
Re^3: Modifying STDOUT and keeping control
by Aristotle (Chancellor) on Oct 14, 2002 at 23:14 UTC |