in reply to Difference between comma and => when calling subroutine

Welcome, zizu1985, to the Monastery!

Please wrap your code within <code>code here</code> tags in your question. It makes it far more legible. As you can probably see, your code looks kind of indecipherable as is. See How do I post a question effectively? for details on formatting.

When formatted, it'd look (something) like this:

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; }

To answer your question. First, note you're speaking of a comma (,) not a colon (:).

A => in Perl is often called a "fat" comma. It acts exactly the same way as a comma, with an additional feature. It will quote the left-hand-side of what's against it for you automatically. In your case above, it just acts like a normal comma, but here's an example of the additional feature in action:

# this will fail, because 'a' is unquoted my %hash = (a, 1); # same thing, but with fat-comma, which quotes 'a'. # this won't break things my %hash = (a => 1);

See the comma operator in perlop.

It would also be nice if you could please edit your question's title and replace "colon" with "comma". The title (which may make searching difficult), along with no code tags will have your question Considered (What is consideration?) for editing by the janitors.