Re: cycle through buffer

2002-01-04 Thread Jenda Krynicky
From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > On Jan 3, Booher Timothy B 1stLt AFRL/MNAC said: > > >Why can't I do something like this? Load everything to a buffer then > >cycle through the buffer? > > Why would you want to? That requires you to store the ENTIRE file in > me

Re: cycle through buffer

2002-01-03 Thread Shawn
Uh, you can... use strict; open(MYFILE,'test2.txt') or die "Can't open test2.txt: $!\n"; my @buffer=; close(MYFILE); for(@buffer) { chomp; But, be aware that if the file is of any size, you can run out of memory very fast and bog the system down... Why don't you just want to iterate

Re: cycle through buffer

2002-01-03 Thread Jeff 'japhy' Pinyan
On Jan 3, Booher Timothy B 1stLt AFRL/MNAC said: >Why can't I do something like this? Load everything to a buffer then cycle >through the buffer? Why would you want to? That requires you to store the ENTIRE file in memory! >#!/usr/bin/perl -w >open(MYFILE,'test2.txt'); >while () { >$buffer