hi perl friends,

how do i pass an argument  into the subroutine &wanted in File::Find? i
tried the code below but it doesn't seem to work normally.
i get the error: "invalid top directory at c:/perl/lib/file/find.pm line
279, <DATA> line 1.

thanks in advance!
jim


my @Files;
while (<DATA>) {
 chomp;
 my ($Dir, $Prefix) = split(/,/, $_);
 my $path = "d:/$Dir";
 &find (\&wanted($Prefix), $path); #argument passed seems to be the source
of the error message...
}

sub wanted ($) {
 my $Prefix = shift @_;
 return if -d $_;
 (my $ext = $_) =~ s/^.*\.(.*?)$/$1/;
 return unless exists $Extension{lc $ext};
 return unless  $File::Find::name eq /\Q$Prefix/i; #check for files w/
prefix name starting in 'fil';
 if (-M _ < 1) {
 push @Files, $File::Find::name;
}

__DATA__
PERLUSER, FIL




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to