#!/usr/bin/perl -w use Data::Dumper; my $sort_func = sub { $b <=> $a }; my @to_be_sorted = (1,2,3); # sort LIST my @new = sort ($sort_func, @to_be_sorted); print Dumper \@new; # sort LIST @new = sort $sort_func, @to_be_sorted; print Dumper \@new; # sort SUB LIST @new = sort ($sort_func @to_be_sorted); print Dumper \@new;