On Sun, 18 Nov 2001, Gregg Irwin wrote: > If I'm processing a file, by lines, thus: > > foreach line read/lines/with file rec-sep [ > > It appears that foreach doesn't call read on each pass, but I thought I'd > ask to see if anyone knows, for certain. I know you can modify the block > that foreach uses and it will see the changes, but I wasn't sure what magic > occurs in this scenario. > > The real question, I suppose, is: Should I cache the return value from 'read > before using it with foreach, or is that unnecessary?
I do this alot, and have worked with the assumption that it is best (metric: [walltime disk-io]) to read once at the beginning and write once at the end, and use as many in-memory buffers as I need inbetween. > > As a side question, does anyone on the list use AWK or think that something > like it (i.e. an auto-driven rule/action file processor) would be useful? > what is parse not doing? > --Gregg > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. > -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
