Anonymous user
Optional parameters: Difference between revisions
→{{header|Perl}}: move hash ref outside of comparison function
Underscore (talk | contribs) (Added Perl.) |
(→{{header|Perl}}: move hash ref outside of comparison function) |
||
Line 372:
(ordering => sub {$_[0] cmp $_[1]}, column => 0, reverse => 0, @_);
my $col = $opt{column};
my $func = $opt{ordering};
my @result = sort
{$
@table;
return ($opt{reverse} ? [reverse @result] : \@result);}</lang>
|