in reply to Sorting files by 3 numbers in the name

Hello crusty_collins,

I would create my own sort mechanism and give it to sort:

my @entries; ... # Loop over your files and extract data push @files, { 'array_position' => $array_position, 'run' => $run, 'copy' => $copy, 'district' => $district, 'total' => $total }; ... my @sorted_files = sort { $a->{'run'} <=> $b->{'run'} || # use '<=>' for numbers $a->{'copy'} <=> $b->{'copy'} || $a->{'district'} <=> $b->{'district'} || $a->{'total'} <=> $b->{'total'} } @files;

This is a sample but you get the picture, extract the values of each file and then based on the values sort them.

Update: Adding array_position.

Hope this helps.

Seeking for Perl wisdom...on the process of learning...not there...yet!