in reply to catch values from txt file

As Tomte said, when you get to actually match your email addresses, use a canned solution from CPAN.

With respect to using such a canned solution at the right time within your file structure, at a cursory glance, breaking your file into lines isn't necessarialy helpful and could well be making your life more difficult. It is possible that some creative use of $\ would greatly simplify your logic of detecting only the email addys your interested in.

However, it's very difficult to speculate further based upon your--probably very accurate, but extremely abstract--description of your file format. A (few) concrete examples of what the file structures look like would make the description much easier to follow and might draw a simpler solution to the overall problem.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller