oryann9> No, but good point. My intent was to determine when -prune was
 set on
oryann9> the CLI what the De-parsed code told me, 1==true, 0==false
 because
oryann9> when I run this code below prune = 0 is not working, its
 descending
oryann9> down "/".

You're misusing it.  Set it within the wanted() routine when you're
 looking at
a directory that you don't want to descend.  It'll be cleared to 0
 before
calling wanted(), so setting it before calling find() is completely
 useless.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.



-

__OUTPUT__

main::(find_hog:47):    if ( $fs eq "/" ) { # only if the root directory
  DB<1> print $fs
/
  DB<2> n
main::(find_hog:48):        find_me ( $fs, 0 );
  DB<2> n

print caller find_me
main::(find_hog:61):    my ( @sorted_large_files, @large_files ) ;
  DB<2>
main::(find_hog:80):        if (@sorted_large_files) {
  DB<2> print caller find_me
invalid top directory at /opt/perl/lib/5.8.2/File/Find.pm line 568, <> line 1.

  DB<3> print $fs
/
  DB<4> n
main::(find_hog:81):            my %meta ;
  DB<4> n
main::(find_hog:82):            for my $file (@sorted_large_files) {
DB<4> n
main::(find_hog:83):                $meta{$file} = {
main::(find_hog:84):                         'uid' => (stat($file))[4],
main::(find_hog:85):                         'gid' => (stat($file))[5],
main::(find_hog:86):                         'sz'  => (stat($file))[7],
main::(find_hog:87):                         'mod' => (stat($file))[9],
  DB<4> print $file
/data/data01/recovery/archives/dubhdv04/2007-11-15,11:21
  DB<5>

/data/... should not be appearing if prune set to false, or 0.

__CODE__

Is this what you mean on line 9? I tried and it does not seem to work, meaning 
it still descending.

1         sub find_me {
2              use Data::Dumper;
3              my $fs = shift;
4              #local $File::Find::prune = shift; ##-- localize prune to just 
this block --##
5              #my @directory = ($fs) ;
6              use constant MAX_SIZE => (25*1024*1024) ;
7              use constant DIVISOR  => (1024) ;
8              my ( $wanted, $list ) = find_by_min_size ( MAX_SIZE ) ;
9              File::Find::find ( { wanted => $wanted, prune => 
$File::Find::prune = shift}, $fs ) ;
10            @large_files = $list->() ;
11
12            @sorted_large_files =
13                 sort { -s $b <=> -s $a }
14            @large_files ;
15
16       } ##-- End sub --##





      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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


Reply via email to