in reply to Excel-like sort for multiple fields unix 'ls -l' output
I would suggest you use a dispatch table as your sort block, ie:
The permissions I'd sort them by their numeric equivalent.sub sortFiles{ my ($field, @data)=@_; my $sortFunction={ timestamp => \&dateSort, filename => \&alphasort, group => \&alphasort, owner => \&alphasort, permissions => \&permSort, } return sort $sortFunction{$field} @data; }
|
|---|