I wrote this mostly as an excercise in nested hash lookup.
(It's still a symbolic lookup, so while it's strict-compliant, it's no safer than saying no strict 'refs' and doing a regular symbolic lookup. Call a spade a spade when you're not goofing off.)
use List::Util qw( reduce ); sub symref { local $_ = shift; reduce { $a && exists $a->{ "${b}::" } ? $a->{ "${b}::" } : () } \%main::, split /::/; }
In reply to Strict-compliant, eval-free symbolic reference lookup by Aristotle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |