Mailing List Archive

Reference count problem with tie'd variables?
[. I sent a similar report to an old perl5-porters address and am now
assuming that it disappeared in the bit bucket as I didn't get any
response. Should my conjecture be wrong and the list instead ignored
it as being inappropriate I would appreciate being told off as
otherwise I may keep pestering the list....]

The following behaviour looks like a bug to me:
If I do
perl bug.pl
I get

See me, hear me, touch me!
Outta sight!

and if I do
perl -x bug.pl
I get

Outta sight!
See me, hear me, touch me!

(which seems the correct behaviour to me).

perl -v

This is perl, version 5.001

Unofficial patchlevel 1m.

.....


-------------------------bug.pl--------------------------
$bug = 1;
#!perl
use TieHash;

sub TieHash::Std::DESTROY { print "Outta sight!\n" }

tie %h,TieHash::Std;

if ($bug)
{
%h = ('a' => 1);
}
else
{
%h = ();
}

untie %h;

print "See me, hear me, touch me!\n";