suppose I have a log file ~ temp.log which contains some information.I need to find 3 patterns from that file..so that if those 3 patterns are found in a file.. then a test case is termed as "passed".
[SNIP]
I need to find 2 patterns in this file:
Were not they 3?!?
  1. Note;ListOpDone(1/50) LISTADD:List=4:Items=2
  2. Note;BlockedSender(1/0) orbsctest1@openwave.com>:[10.196.4.110]:4:3:dropspam:block
These are not patterns. These are strings. So you want these strings to match, but you fail to explain by which criteria they must match. Or do you want to test for exact equality? (Doubt so!)
I have converted both patterns using quotemeta and they look like this.
Well, it's still not entirely clear (to me, that is) what it is that you want to do. But just put the so obtained strings in a match operator and use it. This is basic Perl...
How to search for these 2 patterns in an effient way from a file ?
Since you used quotemeta in the first place chances are you do not want a pattern. Just use C<eq> instead.

In reply to Re: how to search 3 different patterns from a file by blazar
in thread how to search 3 different patterns from a file by athalyes

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.