Hello kcott,
From perlop#The-Arrow-Operator (emphasis added):
"->" is an infix dereference operator, just as it is in C and C++. If the right side is either a [...], {...}, or a (...) subscript, then ....
Otherwise, the right side is a method name or a simple scalar variable containing either the method name or a subroutine reference, and the left side must be either an object (a blessed reference) or a class name (that is, a package name).
So it appears the Perl parser interprets "XYZ"->$x("fred") as $x invoked with the supposed class/package name "XYZ". I believe this parse option is needed to allow constructors to be called correctly.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^5: Moose 'clone' Constructor
by Athanasius
in thread Moose 'clone' Constructor
by kcott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |