in reply to Re: Re: file::find and ordered output
in thread file::find and ordered output

How can it affect the order of the directory processing?
Its effect is that it changes what is passed to the wanted() coderef e.g
find({ preprocess => sub { return sort { $b cmp $a } @_ }, wanted => \&process_array, }, @ARGV);
This will sort the directory listing that process_array() gets in reverse alphabetic order. So basically the preprocess option allows you to change what the wanted() function receives from changing it's order to removing unwanted directory entries.
HTH

_________
broquaint

update: changed <=> to cmp in the sort() (thanks ariels)

Replies are listed 'Best First'.
Re: Re: Re: Re: file::find and ordered output
by Bjoern (Novice) on May 13, 2002 at 11:34 UTC
    Thank you for the prompt input.

    The modification from "<=>" to "cmp" does it. It works fine now.

    Thanks again.

    Bjoern
Re: Re: Re: Re: file::find and ordered output
by Bjoern (Novice) on May 13, 2002 at 10:41 UTC
    With your help I seem to get near the solution, but still it's weird...

    with $a <=> $b I get
    Anastacia Springsteen Laith al Deen

    with $b <=> $a I get
    Laith al Deen Springsteen Anastacia

    there seems to be a kind of sense in the output, but it's still not sorted correct....(or the alphabet in my brain is mixed up)

    I will work on it this evening an let you know about the solution (hope I find one), thanks for the input!

    still pondering

    Bjoern