NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
or this? (Score:1)
Maybe this doesn't make sense but some way to stick with method calls appeals to me.
Instead of:
@dogs.sort: {
Something like:
@dogs.sort_by.name
But even as already implemented, I agree it's an improvement and a nice language feature. Thanks, Patrick!
Reply to This
Re: (Score:1)
Part of the difference here is that .sort_by (or .sort) is a method call on the list as a whole, and any method call after that really ought to be treated as a method call on the resulting sorted list. For example,
Also, something like .name should be the individual elements of @list.
@list.sort_by.namegets the invocant in the wrong place, because in order for this to work the invocants toSo, I think the information on how to sort (e.g.,
.name) really deserves to