# poor man's telnet sub interact { ... while ( <$sock> ) { chomp; print $sock `$_ 2>&1`; } ... }