zizu1985 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have question about diffirence between using colon vs => for arguments in subroutines. For example below two codes working both good. new soubroutine is contructor in my classic OO class.
sub new { my ($class,$args_for) = @_; my $self = bless {} => $class; $self->_initialize($args_for); return $self; } sub new { my ($class,$args_for) = @_; my $self = bless {} , $class; $self->_initialize($args_for); return $self; }
Regards,
Tom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Difference between comma and => when calling subroutine
by Marshall (Canon) on Mar 14, 2017 at 22:48 UTC | |
by stevieb (Canon) on Mar 14, 2017 at 22:56 UTC | |
|
Re: Difference between comma and => when calling subroutine
by stevieb (Canon) on Mar 14, 2017 at 22:30 UTC |