Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Something like File::Find with sorting

by Anonymous Monk
on Feb 16, 2013 at 18:47 UTC ( #1019057=note: print w/replies, xml ) Need Help??


in reply to Re: Something like File::Find with sorting
in thread Something like File::Find with sorting

Or if you want a per-directory view,

my @files; sub search { push @files, $_ if -f; } sub handle_directory { @files = sort { lc($a) cmp lc($b) } @files; # do something with @files print "@files\n"; # get ready for the next directory undef @files; } File::Find::find( { wanted => \&search, bydepth => 1, postprocess => \&handle_directory }, $directory );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019057]
help
Chatterbox?
[choroba]: ovedpo15 Hard to tell without context. You probalby used $dir outside of its scope, which is the body of the "unless".
[choroba]: if you use unless as a statement modifier, you can't use the variable declared in the modifier in the statement.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2018-04-22 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?