@sorted = sort # default sort numeric map { $_->[2] } # grab 3rd field (timestamp) of array (ref) map { [ split(/_/,$_) ] } # split fnames on '_', rtn array ref grep { !/^\./ } # filter out dot files readdir(EVT_DIR); # read all entries