The cheap but punctuation-heavy answer:
my $string = "this is an interpolated method call: @{[$obj->method]}";
What's happening here, working from the inside out:
- The method call happens, and it returns a list of zero or more values.
- Outside that, we have an anonymous array constructor, so now we've got a reference to an anonymous array containing the value(s) returned from the method.
- Outside that, we have @{ }, which dereferences the array reference, so we have an array.
- Perl now happily interpolates the dynamically-generated anonymous array into the string, because it knows how to do that.
This is essentially what Interpolation.pm does, cut down to adding a few extra characters in your string. Drawback: ugly, and possibly really confusing to the reader. Advantage: only 5 extra characters.