Thanks Jeff, thanks Rob.
I used your solution Jeff and it's working a treat.
Cheers,
Nigel
Rob Dixon wrote:
Nigel Peck wrote:
Hi,
I have a list containing the names of all items in a directory. I want
to sort it by non-directories first and then directories, with a
secondary sort in alph
Nigel Peck wrote:
>
> Hi,
Hello,
> I have a list containing the names of all items in a directory. I want
> to sort it by non-directories first and then directories, with a
> secondary sort in alphabetical order.
>
> I currently have:
>
>
> my @items = sort {
>
Nigel Peck wrote:
Hi,
I have a list containing the names of all items in a directory. I want
to sort it by non-directories first and then directories, with a
secondary sort in alphabetical order.
I currently have:
my @items = sort {
my $a_path = $a
I'm sorry that just be clear you want the non-directory first,then
simply change the codes to:
my @items = map { $_->[0] }
sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] }
map { -d $_ ? [$_,1] : [$_,0] } readdir DIR;
2007/4/27, Jeff Pang <[EMAIL PROTECTED]>:
2007/4/27,
2007/4/27, Nigel Peck <[EMAIL PROTECTED]>:
Hi,
I have a list containing the names of all items in a directory. I want
to sort it by non-directories first and then directories, with a
secondary sort in alphabetical order.
Hello,
I've tested, this could work for you.
my @items = map { $_->[0]
Hi,
I have a list containing the names of all items in a directory. I want
to sort it by non-directories first and then directories, with a
secondary sort in alphabetical order.
I currently have:
my @items = sort {
my $a_path = $args->{direc