Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Beginners guide to File::Find

by Aristotle (Chancellor)
on Dec 04, 2002 at 00:10 UTC ( #217378=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    use Getopt::Std;
    ...
    }
       
    printf "%10d $_\n", $size{$_} for @sorted[0 .. $maxidx];
    
  2. or download this
    find( { wanted => \&print_if_dir, }, @dirs);
    
    # or
    
    find( { wanted => sub { print if -d }, }, @dirs);
    
  3. or download this
    find( {
        preprocess => sub { return grep { -d } @_ },
        wanted => sub { print },
    }, @dirs);
    
  4. or download this
    my ($min_depth, $max_depth) = (2,3);
    
    find( {
    ...
        return if $depth < $min_depth;
        print;
    }
    
  5. or download this
    #!/usr/bin/perl -w
    use strict;
    use Getopt::Std;
    ...
        wanted => sub { unlink if -f $_ and -M _ > $max_age_days },
        postprocess => sub { rmdir $File::Find::dir },
    }, @ARGV);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://217378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-07-07 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls