while (defined(my $line = <$NA_Conn>)) { $input.=$line; if ($input =~ / ... /) { process($input); $input = ''; } }