I have a log file with lines that look like [2001/03/12 08:45:38 INFO AVTransaction Compiled Code] Abandon transaction: SYcadChangeOrder:30915 After figuring out transaction numbers I need to scour another logfile to find any match in any line with the $transaction_id. In this case the trans number is 30915. The following snippet doesnt find the match. What am I doing wrong?
open (PROLOG,"$provision_log") || die "Cannot open the + file: $!"; while (<PROLOG>) { chomp; $pro_logline=$_; print "$pro_logline\n"; if ($pro_logline =~ /$transaction_id/) { print "We found a match\nPro_log:$pro_logline\ +nAuditlog $logline\n"; $jhg=<STDIN>; } # End of if prolog } # End of while for Prolog run close (PROLOG);
Thanks in advance!!! RV

In reply to String matching question by vonman

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.