G'day tobyink,
++ Thanks for pointing me to that module: I hadn't encountered it previously.
I found the way you've used coderefs interesting. I suspect I may have seen something similar in the past but probably wasn't paying close enough attention. I'm certainly familiar with:
$ perl -E 'my $x = sub { say "@_" }; $x->("fred")' fred
And, as expected, this didn't work:
$ perl -E 'my $x = sub { say "@_" }; $x("fred")' syntax error at -e line 1, near "$x(" Execution of -e aborted due to compilation errors.
However, I've never written code like:
$ perl -E 'my $x = sub { say "@_" }; "XYZ"->$x("fred")' XYZ fred
I'll have to look into that further. I've read the "Object::Util - Rationale" section. Can you point me to any documentation that explains this in more detail?
— Ken
In reply to Re^2: Moose 'clone' Constructor
by kcott
in thread Moose 'clone' Constructor
by kcott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |