in reply to Sort files

Hello

why dont you push filenames into array , then sort them whenever you need to deal with them sorted ?

foreach my $file (sort @files) { ... }

HTH

Replies are listed 'Best First'.
Re^2: Sort files
by ikegami (Patriarch) on Apr 13, 2006 at 14:51 UTC

    Because it would then look like

    foreach my $file ( map { $_->[0] } sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } map { [ $_, (stat)[9] ] } @files_Test_flat_file_write_over_name_only ) { ... }

    which is a bit more messy.