Since the dereferencing chain is ambiguous, you have to resolve it yourself:
my $word = $rf->{test1}; $tes->$word();
Well, I asked something very similar some time ago. A particularly interesting reply deals both with symbolic and real references: AIUI
$tes->${\$rf->{test1}}();
should work. I haven't tested it though, so caveat. Even if it works, it's certainly clumsy and not very friendly to people seeing it.
In reply to Re^2: calling subs using references.
by blazar
in thread calling subs using references.
by opensourcer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |