in reply to Excel-like sort for multiple fields unix 'ls -l' output

Hi Craig, You need to use different sorts based on whether this is numeric , alphanumeric or timestamp data.

I would suggest you use a dispatch table as your sort block, ie:

sub sortFiles{ my ($field, @data)=@_; my $sortFunction={ timestamp => \&dateSort, filename => \&alphasort, group => \&alphasort, owner => \&alphasort, permissions => \&permSort, } return sort $sortFunction{$field} @data; }
The permissions I'd sort them by their numeric equivalent.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."