>hi perl friends,
>
>i wrote the code below to find all files ending in '.plx' then tell me
>where
>they are. it is suppose to print out the unique directories only. but it
>seems to be printing out redundantly as many times as there are .plx files
>in that same directory.
>can anybody tell me what's wrong with my code?
>thanks for you help!
>jim
Jim,
looks like you hit a symbolic link & that is the reason your are recursing
infinitely.
i have a PERL code that recursively goes through directories and looks for
filenames that match a particular pattern.
This script does not use the File module and is protable acorss all
platforms. Also this script is modular and well commented.
let me know if you would like to have the same.
Rgds
>
>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";
>
>_______________________________________________
>Perl-Win32-Web mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web