in reply to Eval errors though code is successful
This, of course, could also be declared as an 'lvalue' function which would eliminate the ${} prefix. lvalue functions are fun, and I hope that they don't take them away any time soon.sub FindRecord { my ($self) = shift; my ($key) = @_; my $ref = \{$self->{$key}}; if (defined $ref->{path}) { my $path = $ref->{path}; foreach my $bit (@$path) { $ref = $ref->{$bit}; } } return $ref; } # ... sub SomeFunc { my ($self) = shift; # ... ${$self->FindRecord($key)} = $value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Eval errors though code is successful
by AidanLee (Chaplain) on Jul 09, 2001 at 16:13 UTC |