On Tue, Jul 10, 2001 at 01:35:05PM +0100, John Edwards wrote:
> open ( FWLOG, "./logfile.010626");
> 
> while(<FWLOG>) { # Reads one line at a time into memory
> ...
> }
> 
> @data = <FWLOG>; # Reads the whole file into memory
> 
> You are replicating the second case, by reading the file a line at a time,
> then splitting into an array, you are creating a massive array which will be
> memory hungry. In fact, by splitting each line, then storing in the array
> you are creating an array with twice as many elements...

I'm not sure where you're getting this idea.  The relevant split is:

    @fw_logs = split(/;/, $LINE);

Notice that assigns to @fw_logs, it does not append to it.  @fw_logs is only
as big as there are fields in each $LINE.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to