Thanks Thomas.
> -Original Message-
> From: Thomas Bätzler [mailto:[EMAIL PROTECTED]
> Sent: 09 June 2005 09:50 AM
> To: 'Perl Beginners'
> Cc: Tielman Koekemoer (TNE)
> Subject: RE: Read output from script line by line
>
> Tielman Koekemoer (TNE)
Thanks Marcos.
> -Original Message-
> From: marcos rebelo [mailto:[EMAIL PROTECTED]
> Sent: 09 June 2005 09:48 AM
> To: Tielman Koekemoer (TNE)
> Cc: Perl Beginners
> Subject: Re: Read output from script line by line
>
> This way works
>
> open
Tielman Koekemoer (TNE) <[EMAIL PROTECTED]> asked:
> Is there a way you read input from a script line by line. I'd
> rather parse output line by line than do: @out = `script.sh`;
> which seems sloppy. Or is that the best way?
No, not really.
You can do a "pipe open" like this
my $code
This way works
open(my $FH, 'script.sh |') or die ...;
while (my $line = <$FH>) {
...
}
close($FH);
On 6/9/05, Tielman Koekemoer (TNE) <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> Is there a way you read input from a script line by line. I'd rather
> parse output line by line than do: @out