> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/s/send_an_unknown_method_call.md).

# Send an unknown method call

Just for the fun of it, we'll mix in an anonymous role into an integer instead of defining a class.

```perl
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.
