user
Task

Invoke an object method where the name of the method to be invoked can be generated at run time.

Related tasks

* Respond to an unknown method call.
* Runtime evaluation
assistant
(formerly Perl 6)
Just for the fun of it, we'll mix in an anonymous role into an integer instead of defining a class.

```
my $object = 42 but role { method add-me($x) { self + $x } }
my $name = 'add-me';
say $object."$name"(5);  # 47

```

The double quotes are required, by the way; without them the variable would be interpreted as a hard ref to a method.