Thanks for the quick reply. I used the code above which looks to be correct and I get the following error message? Not 100% sure why that error is coming up.
Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11802. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11803. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11804. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11805. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11806. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11807. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11808. Use of uninitialized value in regexp compilation at dns.pl line 23, <U +NZIP> line 11809.
Did you mean to put the following out of the sub()?
open(RECORDS, "/tmp/logs/records.txt") or die "Could not open records +file: $!"; local $/ = undef; # Ignoring binmode as its a text file my $RE = join '|', <RECORDS>; close RECORDS;
I tried moving the stuff above inside the sub and printed the $RE var and got the correct records but got no results. Not sure what the problem is. All in all what I am trying to figure out if there is a faster way to search for each of the 100 key entries in my file against all the logs files. The current problem(if thats what you want to call it) is that it takes almost 1 hour to search for 100 keywords against each of the log files which are about 15-18 MB in size. Thanks again for all the HELP!!

In reply to Re^2: Not sure what I am doing wrong by learningperl01
in thread Not sure what I am doing wrong by learningperl01

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.