On 6/8/07, Robert Hicks <[EMAIL PROTECTED]> wrote:
I see some modules that call "new" like:

my $test = new Some::Module;

and some like:

my $test = Some::Module->new;

Is there a difference and what is the "recommended" way?

Definitely go with

my $test = Some::Module->new;

The indirect object notation is ambiguous and many Perl developers
discourage its use. IIRC, this also made its way to Perl documentation
as well: all the core modules were updated to get rid of these kind of
expressions in its source, documentation and tests.

I'm not sure it's already in 5.8.8 docs but " don't use it [the
indirect notation]! " is what you will hear from many people.



Robert

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to