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 '^]'.