How do I use an index in an array reference as a method reference in Perl?
问题 Similar to this question about iterating over subroutine references, and as a result of answering this question about a OO dispatch table, I was wondering how to call a method reference inside a reference, without removing it first, or if it was even possible. For example: package Class::Foo; use 5.012; #Yay autostrict! use warnings; # a basic constructor for illustration purposes.... sub new { my $class = shift; return bless {@_}, $class; } # some subroutines for flavor... sub sub1 { say 'in