Re: Looping through file for regex

2004-01-02 Thread Rob Dixon
Charles K. Clarkson wrote: > > : While the foreach is certainly more wasteful, why in > : the world would you re-initialize and re-open the > : file multiple times? Why not just open the file once > : and iterate over the file, comparing each line of > : the file to each of the keys in the %input h

RE: Looping through file for regex

2004-01-02 Thread Charles K. Clarkson
Ed Christian <[EMAIL PROTECTED]> wrote: : While the foreach is certainly more wasteful, why in : the world would you re-initialize and re-open the : file multiple times? Why not just open the file once : and iterate over the file, comparing each line of : the file to each of the keys in the %inpu

Re: Looping through file for regex

2004-01-02 Thread Rob Dixon
James Edward Gray II wrote: > > On Jan 2, 2004, at 10:46 AM, Ed Christian wrote: > > > James Edward Gray II wrote: > >> On Jan 2, 2004, at 10:10 AM, Paul Kraus wrote: > >> > Don't do that. The foreach reads the whole file into memory and > then walks it line by line. If we just want one

Re: Looping through file for regex

2004-01-02 Thread James Edward Gray II
On Jan 2, 2004, at 10:46 AM, Ed Christian wrote: James Edward Gray II wrote: On Jan 2, 2004, at 10:10 AM, Paul Kraus wrote: Don't do that. The foreach reads the whole file into memory and then walks it line by line. If we just want one at a time, let's fetch them that way I don't agree with thi

RE: Looping through file for regex

2004-01-02 Thread Ed Christian
James Edward Gray II wrote: > On Jan 2, 2004, at 10:10 AM, Paul Kraus wrote: > >>> Don't do that. The foreach reads the whole file into memory and >>> then walks it line by line. If we just want one at a time, let's >>> fetch them that way >> >> I don't agree with this. > > And I don't underst

Re: Looping through file for regex

2004-01-02 Thread James Edward Gray II
On Jan 2, 2004, at 10:26 AM, Paul Kraus wrote: I don't agree with this. And I don't understand this. ;) I don't expect the minds of mere mortal to comprehend my infinite knowledge ;) (Tongue firmly in cheek) Yeah, you know us pesky mortals. If you're going to work with the lines one at a time a

RE: Looping through file for regex

2004-01-02 Thread Paul Kraus
> > I don't agree with this. > > And I don't understand this. ;) I don't expect the minds of mere mortal to comprehend my infinite knowledge ;) (Tongue firmly in cheek) > If you're going to work with the lines one at a time anyway, what > exactly is the advantage of using the probably slower and

Re: Looping through file for regex

2004-01-02 Thread James Edward Gray II
On Jan 2, 2004, at 10:10 AM, Paul Kraus wrote: Don't do that. The foreach reads the whole file into memory and then walks it line by line. If we just want one at a time, let's fetch them that way I don't agree with this. And I don't understand this. ;) If you are working with a file that is a

RE: Looping through file for regex

2004-01-02 Thread Paul Kraus
> Don't do that. The foreach reads the whole file into memory and then > walks it line by line. If we just want one at a time, let's fetch them > that way I don't agree with this. If you are working with a file that is as small as the one included seems to be easier to just load up some data str

Re: Looping through file for regex

2004-01-02 Thread David Byrne
Thank you James for both your advice and suggestions. I think that solved my problem. I'm learning... David --- James Edward Gray II <[EMAIL PROTECTED]> wrote: > On Jan 2, 2004, at 9:33 AM, David Byrne wrote: > > > Greetings, > > Howdy. > > > I've created a hash from an INPUT file and I'm >

RE: Looping through file for regex

2004-01-02 Thread Paul Kraus
> Greetings, Hello > I've created a hash from an INPUT file and I'm trying > to search for each key from the hash in a DATA file. > However, I can't get my script to iteratively loop > through the DATA file for each key. Instead it loops > through DATA once for the first key. Below is some > sam

Re: Looping through file for regex

2004-01-02 Thread James Edward Gray II
On Jan 2, 2004, at 9:33 AM, David Byrne wrote: Greetings, Howdy. I've created a hash from an INPUT file and I'm trying to search for each key from the hash in a DATA file. I'm a little fuzzy on this part, but will see if I can figure it out. However, I can't get my script to iteratively loop thr