At 08:37 PM 10/22/01 +0200, José A. Ferrer wrote:
>Please,
>
>I have a text file separated with one or more whitespaces. I need to 
>extract each line to scalar variables everything but whitespaces. How can 
>it be done in perl ?

open IN, $file or die "open failed for $file: $!\n";
while (<IN>) {
   my @fields = split;
   # Now do something with @fields
}
close IN;

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to