in reply to Given a tie object, get a tied hash (or scalar, or whatever)
That's a rather hackish solution, but it should give you some idea of what to do.{ package Tie::Hash::Foo; use Tie::Hash; @ISA = 'Tie::StdHash'; sub recreate { tie my %tmp, __PACKAGE__; %tmp = %{$_[0]}; return \%tmp; } } use Data::Dumper; my $obj; { $obj = tie(my %hash, 'Tie::Hash::Foo'); %hash = qw/foo bar/; } my $hash = $obj->recreate; print "%\$hash is tied\n" if tied(%$hash); print Dumper($hash); __output__ %$hash is tied $VAR1 = { 'foo' => 'bar' };
_________
broquaint
|
|---|