my $obj = <class>->new();
always. There is nothing magical about "new" in Perl, it is just an identifier that happens to be commonly used as the name of a function generally used to construct objects. The down side with the non -> version of the function call is that perl may become confused at times and not recognise it as a function call (although I can't think of an example at present).
In reply to Re: new <class> or <class>->new()?
by GrandFather
in thread new <class> or <class>->new()?
by LesleyB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |