So - the guys above said their piece, but just for my own 2 cents, there's value to be had from this exercise, because doing multi-matching without getting too loopy is tricky.

So from your question, you have two filehandles, FILE1 and FILE2. You need to exract "a line" from FILE2 "that matches several values" from FILE1. So we need to presume you've already hit the matching conditions to know what you're looking for from FILE2.

Which is interesting, because if you know what the value is, then it gets reduced to:

(This is not valid, just giving you the idea)
FILE2 =~ s/my stuff to get removed//g;

In short, you need to give more information than you just did, because logically following what you wrote, you're asking us how to delete lines from a file that match a condition, which results in the above pseudo-code.


In reply to Re: Extract line, matching more than one variable by Numbski
in thread Extract line, matching more than one variable by yads25

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.