... print $chan "ls\n"; my @response = (readline $chan);