I don't see anything broken in this code, so the bug is either more subtle than I can see through or it's hiding outside of this snippet. I was about to suggest checking for a trailing newline on your transaction ID, but setting it explicitly would have revealed that one. The other easy error would be if $transaction_id was set incorrectly (via typo in its name, for instance). If those aren't it, it's time to get your hands a bit dirtier.
You seem to be going through most of the requisite error-finding steps, but there are a couple of other things you might try to pin down the bug. First, turn on use strict and warnings (#!/usr/bin/perl -w) if you haven't already, which it seems. You'll have to declare all your variables, but you'll thank yourself in the long run. If that doesn't uncover anything, progressively simplify your code until it does work. For instance, explicitly put a numeric ID you know exists (i.e. because the script prints it from the print "$pro_logline\n" statement) in the regexp instead of /$transaction_id/. If that doesn't work, something wacky is going on. If it does (and it should), compare each $transaction_id you search for against the known ID. You should see at least one match there; if not, the ID is somehow being read incorrectly.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|