develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #8931] FETCH for tied $" called an odd number of times.

Thread Previous | Thread Next
Brian Fraser via RT
May 24, 2012 22:51
[perl #8931] FETCH for tied $" called an odd number of times.
Message ID:
On Fri Apr 12 00:54:59 2002, RT_System wrote:
> On Fri, Apr 12, 2002 at 04:32:02PM +0200, wrote:
> >
> > (or should this be skipped by default ? are obfuscated
> > regression tests that useful ?)
> I think the advantage of "obfuscated" tests is that they combine
> features in a surprising way. 
> The test suite probably checks whether $" works as intended,
> it also tests whether tieing works correctly. But it's the
> combination that failed here: $" being tied to a function
> with side effects. 
> Abigail

Actually, it's worse than that:

my $i = 0;
sub A::TIESCALAR {bless [] => 'A'}
sub A::FETCH {print ++ $i, "\n"}

tie my $a => 'A';
join $a, 1..10;

Will call $a's magic for every element. So it's not tie+$", but tie+join
that are broken. Weird that this ticket ended up creating a whole new
section of the test suite, but didn't get the issue fixed, eh?
In any case, the attached patch seems to do the trick. It's just one
line, which probably means that it's broken somehow.


via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About