Re: What is 'new' doing?
- From: theillien@xxxxxxxxx (Mathew Snyder)
- Date: Wed, 22 Nov 2006 05:06:13 -0500
Thanks!
Mathew
Adriano Rodrigues wrote:
On 11/22/06, Mathew Snyder <theillien@xxxxxxxxx> wrote:.
In this line of code what is 'new' doing?
my $users = new RT::Users(RT::SystemUser);
Mathew,
This is called the indirect object notation. It is invoking the method
'new' of the package 'RT::Users', with arguments ( RT::SystemUser ).
It is not recommended anymore. Most code today uses the
straightforward and unambiguous construction
my $users = RT::Users->new(RT::SystemUser);
See this link
http://perldoc.perl.org/perlobj.html#Indirect-Object-Syntax-indirect-object-syntax-invocation%2c-indirect-indirect
or look for the section "Indirect Object Syntax" on perldoc perlobj.
Regards,
Adriano Ferreira.
- References:
- What is 'new' doing?
- From: Mathew Snyder
- Re: What is 'new' doing?
- From: Adriano Rodrigues
- What is 'new' doing?
- Prev by Date: Re: What is 'new' doing?
- Next by Date: RE: How to make a perl program to an exe file (U)
- Previous by thread: Re: What is 'new' doing?
- Next by thread: Re: What is 'new' doing?
- Index(es):