Then you might want to start looking into CPAN modules, for example a really quick search brings up Data::Path.
Otherwise, although I would really try to avoid string eval as much as possible, when it is used it's best to limit its scope as much as possible: $self = eval qq{ \$self->$path }; die $@ if $@;
In reply to Re^7: Creating flexible method accessor
by Anonymous Monk
in thread Creating flexible method accessor
by puterboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |