develooper Front page | perl.perl5.porters | Postings from September 2001

Re: error dereferencing array in a tied hash

Thread Previous
From:
Michael G Schwern
Date:
September 29, 2001 10:46
Subject:
Re: error dereferencing array in a tied hash
Message ID:
20010929134559.D1020@blackrider
On Sat, Sep 29, 2001 at 09:09:40AM -0400, Steve Sapovits wrote:
> I have a hash tying package that works EXCEPT when references
> are returned and used in block constructs like this:
>  
>    my $h = {};
>    tie %$h, "MyTie";
>    $h->{KEY} = [];
>    push(@{$h->{KEY}}, (qw/foo bar/));  # THIS FAILS

Given that this code works:

    use Tie::Hash;
    my $h = {};
    tie %$h, "Tie::StdHash" or die;
    $h->{KEY} = [];
    push(@{$h->{KEY}}, (qw/foo bar/));
    print "@{$h->{KEY}}\n";

and not being able to see your code, I can only assume the problem is
in your implementation.  Sorry. :(

> This Tie relies on lots of internal code so I can't post it.  I also
> can't reproduce the problem with a smaller tie.


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
Your average appeasement engineer is about as clued-up on computers as
the average computer "hacker" is about B.O.
	-- BOFH

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About