So you think setting $/ = "\n\n" and ($headers) = <$fh> should be faster? Sounds very interesting.
Then regex against $headers and anchor against specific headers. But, many addresses are "hidden" in the first received header because of mailing lists or other things, because of that I had looked at the entire header. Maybe /(?:^To:\s+|^CC:\s+|<)$address/ms?
I lowercased the entire line because I thought that would be faster than a case insensitive regex.
I generally use /xms on all my regexes as that is how I expect them to work, and if I add them, it doesn't hurt even if I don't use the feature. Is there a reason NOT to use /x and /s? Do they slow down the regex?
Thank you for many things to try to figure out setting up a benchmarks for.
In reply to Re^2: Looking for ideas on how to optimize this specialized grep
by afresh1
in thread Looking for ideas on how to optimize this specialized grep
by afresh1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |