jryan has asked for the wisdom of the Perl Monks concerning the following question:
Lets say I have a tied variable, like this:
use Tie::HashTree qw(hash_to_tree); my $tree = tie my %x, 'Tie::HashTree';
and the constructor looks like this:
sub TIEHASH { my ($class, $self) = @_; $self->{level} = ""; $self->{name} = "top"; $self->{top} = {}; bless ($self, $class); }
Instead of "top", I'd like the name to be the name of the tied variable. Is there any way to do this without forcing the user to input another argument?
Thanks, jryan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there any way to find the name of a tied variable?
by blakem (Monsignor) on Sep 11, 2001 at 04:40 UTC | |
|
Re: Is there any way to find the name of a tied variable?
by suaveant (Parson) on Sep 11, 2001 at 05:41 UTC |