Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Regex with two strings from files

by Marshall (Canon)
on Mar 01, 2017 at 07:05 UTC ( [id://1183248]=note: print w/replies, xml ) Need Help??


in reply to Regex with two strings from files

I am very confused by your question. It is not at all clear what you are trying to do?

Your code has glaring errors, e.g.

for my $parse1 (@parse_terms1) { seek( $fh2, 0, 0 ); while ( my $parse2 = <$fh2> ) {
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.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1183248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found