jim wrote:
> 
> thanks a lot Michael. the code you wrote is just what i wanted to achieve.
> 
> i wrote the code bec. i'm learning & practicing perl.
> 
> if you have time, can you pls. point out to me what's wrong w/ my code. i
> still do not understand why it doesn't work.

File::Find calls sub wanted for *each* file and subdir it finds in a dir.

So all you have to do is deal with one file when inside wanted unless you 
want to deal with the whole dir and then prune the tree to stop the recursing.

> > > use File::Find;
> > >
> > > find(\&wanted, "c:/perluser/");
> > >
> > > sub wanted {
> > >  my @dir = "$File::Find::dir"if m/\w\.plx/i;
> > >  print "@dir\n";
> > >  my %seen;
> > >  my @unique_dir = grep {! $seen{$_}++} @dir;
> > >   foreach $dir_in (@unique_dir) {
> > >    #print "$dir_in\n";
> > >    $count++
> > >   }
> > > }
> > >  print "\n", 'There are ', "$count", ' files', "\n";

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.todbe.com/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to