I am new to Perl and currently learning Perl object oriented and came across writing a constructor.
It looks like when using
It is not first parameter to
new, but indirect object syntax,
perl -MO=Deparse -e 'my $o = new X 1, 2'
which gets parsed as
my $o = 'X'->new(1, 2);
Perl suports another method invocation syntax called "indirect object" notation. This syntax is called "indirect" because the method comes before the object it is being invoked on.
That being said,
new is not some kind of reserved word for constructor invocation, but name of method/constructor itself, which in perl is not enforced (ie.