3 ms·
"extreme late-binding" Perl allows you to do: $object->$method($arg); And a special can() method to see if $method exists...returns a usable code reference.
by tyingq 8y ago
"extreme late-binding"
Perl allows you to do:
$object->$method($arg);
And a special can() method to see if $method exists...returns a usable code reference.
There's even a pretty nutty wildcard way of handling methods/functions that don't exist, as if they do (AUTOLOAD): https://perldoc.perl.org/perlsub.html#Autoloading https://perldoc.perl.org/perlsub.html#Autoloading
Though I've never run into a plausible reason to do any of that.