Re: Newbie splitting

2001-10-22 Thread "José A. Ferrer"
>It's always better to reply in the mailing list also, since some users are >always better and can correct code:-) Sorry for that. Yes, this is what I'm looking for. Thank you >To access each field, you just have to access theindivudual array elements > >open FILE, $file or die "Cannot open

Re: Newbie splitting

2001-10-22 Thread Etienne Marcotte
It's always better to reply in the mailing list also, since some users are always better and can correct code:-) To access each field, you just have to access theindivudual array elements open FILE, $file or die "Cannot open file: $!\n"; while () { my @list = split; # splits using a space as deli

Re: Newbie splitting

2001-10-22 Thread Peter Scott
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 () {

Re: Newbie splitting

2001-10-22 Thread Etienne Marcotte
open the file, while () { my @list = split(/ /, $_); ..do something with the list.. } This way you have to make the appropriate work inside each loop in the while because @list gets the new line value each time.. Etienne "José A. Ferrer" wrote: > Please, > > I have a text file separated wit

Newbie splitting

2001-10-22 Thread "José A. Ferrer"
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 ? TIA. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]