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
In reply to Difference between comma and => when calling subroutine by zizu1985
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |