in reply to Regex with two strings from files
Your code has glaring errors, e.g.
Never re-read the same file (in your code, your file handle <$fh2> and the seek) more than once without an exceptional reason. You have many loops within loops in this section of code the purpose of which are not at all clear.for my $parse1 (@parse_terms1) { seek( $fh2, 0, 0 ); while ( my $parse2 = <$fh2> ) {
You do not explain what parse1 or parse2 are intended to do. Or why they even should be separate files?
It looks like to me that you should use the files, parse1,2 to build a regex that is then executed over a number of directories and/or files?
I do not see any examples of what should "match" and what should "not match" with a simple example.
Your best bet is to start over and explain in English what you are trying to do.
It would be helpful to me if you could show some simple examples of the input contained within the files and what you intend to match or not match. I simply do not understand enough about the problem to be of further assistance.
|
|---|