----- Original Message ----
> From: Aristotle Pagaltzis <[email protected]>
>
> I would write that
>
> my $self = shift;
> my ( $name ) = @_;
>
> :-)
>
> (To my way of thinking, the invocant is not a positional
> argument, so I always pull it out of @_ with a `shift`,
> whereas I unpack arguments using list assignment.)
Why does this matter? Aside from being able to do this a touch cleaner:
sub foo {
my $self = shift;
my ($name) = @_;
$self->SUPER::foo($name); # if you're still using SUPER::
...
}
I know this formatting is common, but what practical benefit does it gain? It
almost sounds like how I do this:
my $val = join '-' => @args;
The '=>' is something I'm often asked about because I like to visual
distinction
between subject and predicate. Aside from that, I'm unsure what "value" this
provides other than conforming to a particular coding preference (and it's more
ops, but that's probably not enough for it to be a performance win to avoid it).
(I'm not criticising. I'm genuinely curious to know how this helps)
Cheers,
Ovid --
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://blogs.perl.org/users/ovid/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6