oops, overlooked the obvious: you are opening the file for appending only,
not for reading... :)


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Eduard Grinvald" <[EMAIL PROTECTED]>
Cc: "Perl Discuss" <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 9:01 PM
Subject: Re: creating @array


> > 2) The best way to get a file into an array is simply @array =
> > FILEHANDLE
>
> when i do this:
>
>     open(FILE, ">>$filename");
>       print FILE "$add\@$domain\t$destination_email\n";
>       @entries = <FILE>;
>     close(FILE);
>     @entries = sort(@entries);
>     $n = @entries;
>     $o = 0;
>     open(NEWFILE, ">>$tmpfile");
>     until ( $o > $n ) {
>       print NEWFILE "$entries[$o]\n";
>       $o++;
>     }
>     close(NEWFILE);
>
> i still seem to be reading nothing into the array. the value of $n is 0.
> when i read a file into an array, does each line of the file become its
> own element? for some reason, i don't think i am getting the data into the
> array that i think i am putting there :)
>
> thanks -charles
>
>

Reply via email to