die "command error\n" unless multi("command") ; while (1) { my $line = multi() ; last if $line =~ /^./ ; {process the line} }