So I wrote a Perl script about 5 months ago to parse a rather strange text file. Here's a sample of the source file:
AACE_1:
{
class: mic_if_win,
label: "!AACE.*",
mic_if_handles_windows: 1
}
{
rtree_state: close,
ltree_state: close
}
AACE_1."ADDR LINE1":
{
class: field,
id: 734
}
etc. (For those who may recognize it, it's a GUI Map file used by WinRunner, an automated testing suite.) Each header of a braced chunk is either a screen (green-scren) name or field name - the field names have the screen name they're on, followed by ".", followed by the field name. To determine whether I'm on a line that contains a screen name, I use this line:
if ($desc != 0 and /^([^.]+):$/) {
# do stuff
}
Looking at that regex now, I think, it'd be smarter to use
/^(\w+):$/
but that's not the issue. Both the original regex and the one I have above produce this warning for each and every line of input:
Use of uninitialized value in concatenation (.) or string at ./genguim
+apdoc.pl line 52, <GUIFILE> line n.
WTF? This script worked perfectly 5 months ago. The input file has not changed, nor has the script. Is there something fundamentally wrong with the regex?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.