At 05:27 PM 9/13/2001 +0200, Jorge Goncalvez wrote:
>Hi, How in Perl you can store each line of a file in an array?

>From section 4.1 in the Perl Cookbook
(http://www.oreilly.com/catalog/cookbook/):

@bigarray = ();
open(DATA, "< mydatafile")       or die "Couldn't read from datafile: $!\n";
while (<DATA>) {
    chomp;
    push(@bigarray, $_);
}

Regards,
- Robert


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

Reply via email to