eak has asked for the wisdom of the Perl Monks concerning the following question:
Can't use an undefined value as an ARRAY reference at ./example.pl lin +e 37.
$hash{blah} = 1;
$user = { 'val' => 1 };
#!/usr/bin/perl -w package MyTie1; sub TIEHASH { bless {}, shift; } sub STORE { my $self = shift; my ($key, $value) = @_; $self->{$key} = $value; } package MyTie2; sub TIEHASH { bless {}, shift; } sub FETCH { my $self = shift; my $key = shift; my %hash; tie %hash, 'MyTie1'; $hash{blah} = 1; return [{val => 1}]; } package main; my %hash; tie %hash, 'MyTie2'; use Data::Dumper; foreach my $user (@{$hash{one}}){ print Data::Dumper->Dump([$user],['user']); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: tie-ing then tie-ing again
by tye (Sage) on Apr 11, 2001 at 19:37 UTC |