in reply to new <class> or <class>->new()?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: new <class> or <class>->new()?
by JavaFan (Canon) on Nov 21, 2011 at 11:53 UTC |