in reply to Re^2: Sorting Directory and Filenames
in thread Sorting Directory and Filenames

my @files; while(<>) { chomp; push @files, $_; }

is a long winded way to say

chomp( my @files = <> );

And here's an alternate version that should be much faster for long lists:

my @sorted = map /.*\0(.*)/s, sort map lc(dirname($_)) . "\0" . lc(basename($_)) . "\0" . $_, @files;