I was having issues getting it to work - but then I moved from a one-liner to a program and suddenly the world was fine. I think that the similar action in new would work on your calls also.

Thank you: in view of the other answers the problem is not so much of a problem any more. Yet I was annoyed by not being able to use weaken appropriately, and you gave me an explicit example about how to put it to work. Thinking of your actual example code, anyway, makes me think that while weaken() is a precious tool, perhaps a more direct interface to the ref count of a reference could be desirable. Perhaps a lvalue refcount() function to be used (mostly) like thus:

refcount($ref)--;
Update - Just to double check I used the following lvalue based subref which worked also.

Well, I wouldn't have expected that to make a difference anyway...


In reply to Re^2: Agile syntax (abuse?) by blazar
in thread Agile syntax (abuse?) by blazar

Title:
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, 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:
    & &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.