open(PIPE, "telnet 192.168.1.1 |") or die $!; while () { $bah = $_; $bah =~ s/192.168.1.1//; print $bah; } close(PIPE); bash~$ perl test.pl Trying ... Connected to . Escape character is '^]'. #### use IPC::Open2; print open2(\*IN, \*OUT, "telnet 10.65.2.252"); print OUT "Trying\n"; while () { $_ =~ s/10.65.2.252//; print; } close IN; close OUT; bash~$ perl test1.pl 26210Trying ... Connected to . Escape character is '^]'.