my $obj = CGI->new(); is preferable.
The other method is known as "Indirect Object Syntax", and is usually discouraged because the syntax is ambiguous, and in some cases can be interpreted the wrong way. There's an explanation in perlobj under the heading, "Indirect Object Syntax".
Dave
In reply to Re: new <class> or <class>->new()?
by davido
in thread new <class> or <class>->new()?
by LesleyB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |