develooper Front page | perl.perl5.porters | Postings from August 2010

[PATCH] Re: [perl #77496] tied gets scalars and globs confused

Father Chrysostomos
August 29, 2010 13:43
[PATCH] Re: [perl #77496] tied gets scalars and globs confused
Message ID:

On Aug 29, 2010, at 1:38 PM, Father Chrysostomos wrote:

> In trying to write a test for an assignment bug, I came across this anomaly with tied():
> sub TIESCALAR {bless[]}
> sub FETCH { 1 }
> sub STORE{}
> tie $rin, "";
> $rin = *rin;
> print qw[good bad][!tied $rin];
> tied returns undef, so this prints ‘bad’. tied checks first to see whether its argument is a glob. If it is, it returns undef if the IO slot is empty.
> So the the tiedness, according to tied(), varies depending on what the last value happened to be that was returned or assigned.

There should be a patch attached hereto. I put the explanation of OPf_SPECIAL above OP_HELEM to avoid a conflict with the patch for bug #20444. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About