There is nothing much wrong with the code you have posted (with the provisos mentioned below) but the problem appears to be in the pattern(s) in your if statement. The error message indicates that you are using some undefined variable in one or other of the pattern matches in that statement. However, you don't have any variables within the patterns shown--perhaps you should post the actual code?
A couple of other comments: please put your code in <code> tags--this would make it much more readable. You would probably be better to use lexical (my) rather than package (our) variables in your use case. Finally, you are missing a terminating "/" in the first pattern match, presumably because you have retyped a shortened version of your code. There is nothing wrong with showing PerlMonks a shortened version of your code--in fact it is encouraged--but it needs to be runnable, and demonstrate the bug.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||