in reply to RE: (2) elementary hash
in thread elementary hash, STDIN questions
Are you interesting in something that applies one regex to a one sort of log file and another regex to another sort? If so, you're nearly there. If you can parse the input filenames (or the output filenames, come to think of it) to get a unique string corresponding to each type of file you want to edit, then you could put the pattern into a hash based on the string you parsed out of the file names. If you don't have many types of files, that's a good solution.
If you have a _lot_ of types of files, or if the regex is going to change a lot, I'd consider biting the bullet and writing a config file. Then, once you've parsed the file name, get the regex for that type of file from the config.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: (4) elementary hash
by ybiC (Prior) on Sep 12, 2000 at 01:39 UTC |