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 ).
In reply to Re: Re: Modifying STDOUT and keeping control
by Anonymous Monk
in thread Modifying STDOUT and keeping control
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |