in reply to tie-ing then tie-ing again
Looks like a bug in Perl to me. You can't used a tied variable inside of another tied variable's FETCH. I did some experimenting and came up with the following case that also illustrates the problem but with fewer moving parts inside the FETCH call:
I recommend you report this using the perlbug script that comes with Perl. - tye (but my friends call me "Tye")#!/usr/bin/perl -w package MyTie1; sub TIEHASH { bless {}, shift; } sub FETCH { my $self = shift; my $key = shift; return [{foo=>'bar'}]; } package MyTie2; sub TIEHASH { my $self= {}; my %hash; $self->{hash}= \%hash; tie %hash, 'MyTie1'; bless $self, shift; } sub FETCH { my $self = shift; my $key = shift; return [{val => $self->{hash}->{key}}]; } package main; my %hash; tie %hash, 'MyTie2'; use Data::Dumper; foreach my $user (@{$hash{one}}){ print Data::Dumper->Dump([$user],['user']); } __END__ Can't use an undefined value as an ARRAY reference at refetch.pl line +33.
|
|---|