Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Okay, I should have been able to start deducing the comma thing by that point, too. I'm not sure why I was so oblivious to it. I did find the culprit however. I had nailed the problem down to 20 lines of code and your comment about a comma (makes absolute sense) lead me to the precise line that was glitching.

I'm embarrassed to admit this, but the following is the problem that was tripping me up. Note that the code has behaved exactly as wanted and expected for over a year with this line in it - go figure!

Problematic line:

if (defined($duplicate_email_address), defined($matched_uid))

Obvious to anyone with a brain and a set of eyes (except myself apparently), the problem with the above line is that there is a comma where the && operand should be.

All I can offer in my defense is that I never suspected a problem like that because I'd have expected it to cause a syntax error or prevent compiling.

I can also now recall the exact step that lead me to this problem over a year ago when I wrote this new batch of code. I had copied the contents of something like my ($foo, $bar, $blah) = $sth->fetchrow_array; and then used that in a conditional and never went back to modify the syntax.

This was the last thing I was investigating. Every time I went back to check this code and see if I could find the cause of that error, I was looking for things more like a variable that was being defined but never used or something. Gah! So frustrating!

On a positive side, I rarely make the same mistake twice and I learned a thing or two from this thread. Thanks again, monks.


In reply to Solution. by Seumas
in thread "Useless use of private variable in void context" by Seumas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found