Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Somewhat more specifically, you want to know when the statement handle is no longer being used so that it can clean itself up (and perhaps warn that you left it in an unfinished state, probably indicating a bug).

The described bug that is prevented by removing the quoting sounds exactly like somebody has a bug in their ref count management in their XS code. It sounds like somebody has marked a variable as "mortal" and so the subsequent method call decrements the variable's ref count, destroying it even though an attempt is then made to use it. The destruction doesn't happen if the returned blessed reference is saved into a named variable.

Have fun finding the ref counting bug in the XS code. It is rarely even close to an easy task. On the other hand, introducing such bugs is extremely easy in XS code and is probably one of the major contributors to the rather frequent problems I see with "weird bugs" that just "go away" when some XS module stops being used (even though the XS module doesn't even seem related to the "weird bug").

I wish more XS authors learned to only manipulate Perl data structures from Perl code, strictly minimizing their XS code. Or, usually better, just skip the XS code altogether.

- tye        

In reply to Re^2: method chaining fails where separate method calls succeed in DBIx::Simple (XS mortals) by tye
in thread method chaining fails where separate method calls succeed in DBIx::Simple by Anonymous Monk

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, 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
  • 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (8)
    As of 2015-11-30 07:51 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (765 votes), past polls