Perl'ers, 

In my code I call a find routine called xyz based on what the user enters which 
can be "/" or /\w+.
Instead of having one block of code and another block of the same code, but 
with $File::Find::prune = 1;
can't I just pass this $File::Find::prune = 1; to my single find routine based 
on their entry?

use strict;
use warnings;
use File::Find ;
use File::Find::Closures qw(find_by_min_size) ;

<snip>
chomp (my $fs = <>) ;

if ( $fs =~ m|\x2f{1}?|g ) {  ##-- if "/" is matched --#
    $File::Find::prune = 1;
    find_me;
}
elsif ( $fs !~ m|\/\w+| ) {
    find_me;   

find_me {
 my @directory = ($fs) ;
    use constant MAX_SIZE => (25*1024*1024) ;
    use constant DIVISOR  => (1024) ;
    my ( $wanted, $list ) = find_by_min_size ( MAX_SIZE ) ;
    File::Find::find ( { wanted => $wanted, }, @directory ) ;

<snip>
}
<snip>

thank you




      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to