Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

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

But from that thread seems to refer to a (possible) bug in tied arrays, whereas I found a (possibly) anomalous behaviour with tied scalars.

However, this particular post from that thread brings me to

Both hint at the fact that tied vars may... well, evaluate twice under some circumstances. In particular the former seems to refer to a different situation, but the latter portraits exactly the same one as mine. But the same article claims that it was a 5.6.1 specific bug and that it should have been patched - here's the relevant quote:

I searched p5p and it appears to have been reported and patched in development versions --- I just wanted to let people here know so they might avoid some confusion if they run into it. A relevant p5p link (from which the patch is linked) is: here

May it be that the patch never made its way in the next releases or that the same bug has been reintroduced subsequently?

Remark: more importantly, it seems that the FETCH method is not called twice:

#!/usr/bin/perl -l use strict; use warnings; sub TIESCALAR { bless \my $i, shift } sub FETCH { warn "FETCH called!\n"; ${shift,}++ } tie my $s, 'main'; print "$s$s$s"; __END__
Output:
FETCH called! FETCH called! FETCH called! 112


In reply to Re^2: tie() weirdness by blazar
in thread tie() weirdness by blazar

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 perusing the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found