in reply to Grep Effeciency

You are iterating over the same list two four times. Why? You could write this using "foreach" and simply use conditionals to test each regex (with a push for valid values). In fact, your second "grep" only gives you a subset of your first "grep", so make sure to pay attention for things like that as you recode. You can probably also skip some regexes by using "next" within the "for" loop, if there are mutually exlusive matches.

Update: Oops. Dyslexia. Looping twice for each structure. Still once too often. (Note, I would also make those list names a little less like each other. {grin} )

Replies are listed 'Best First'.
Re: (ichimunki) re: Grep Effeciency
by ImpalaSS (Monk) on Feb 28, 2001 at 00:41 UTC
    Well,
    There are 2 seperate files. The ECL_STAT and the CEL_STAT. Then there are 1200 NETID's. What im trying to do ( with maximim speed) is, grab all the data from (ECL_STAT), then split each line found, and perform calculations to certain fields. Then, do the samt thing to the CEL_STAT file using the same netid. It is faster if i dont use the second line (the !/^$NETID/) one, but i wanted to show what i want to do. I want it so that, once all the $NETID's (for example 12753pa), delete those lines from each array, thus making the arrays smaller and easier to search the next time around?

    I hope this makes some kind of sence

    Thanks



    Dipul