in reply to Re^2: Better syntax for dynamic method on internal object ?
in thread Better syntax for dynamic method on internal object ?

It works with a sub ref returned from can for me:
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; { package My::Url; sub new { my $class = shift; bless {@_}, $class } sub url { my ($self, $node_id) = @_; $self->{url} . '?node_id=' . $node_id } } my $o = 'My::Url'->new(url => 'http://www.perlmonks.org/'); my $methodname = 'url'; my $methodref = $o->can($methodname); say $o->$methodref(1142751);

But even if it didn't, you know the name, right? You used it as the argument to can.

Update: It's documented.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ