use strict; use warnings; package joe; my @names = ('joe', 'aaron'); package FP; sub sortNames ($$) { my ($x, $y) = @_; print "$x vs $y\n"; return $x cmp $y; } package joe; my @sorted = sort {FP::sortNames($a,$b)} @names; print "sorted : @sorted\n";
In reply to Re: sort sub in a different package
by dragonchild
in thread sort sub in a different package
by blahblahblah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |