Here are two examples of using File::Find, the first
has the subroutine within the find. The second has it
outside the find.
Both examples only have one directory starting point,
since I have not experimented with multiple starting
points.
# ==================== first variation
my $dir = "c:/_/perl/";
find(sub { # sub is w/in find.
-f # just ordinary files.
and /.+\.txt$/i # that end with .txt
and print "$File::Find::name\n" # full path.
}, $dir);
# ==================== second variation
my $dir = "c:/_/perl/";
find (\&wanted, $dir ); # sub is seperate.
sub wanted{
-f # just ordinary files.
and /.+\.pl$/i # that end with .pl
and print "$File::Find::name\n" # full path.
}
I hope this helps.
Reguards,
Jim
--- ���� <[EMAIL PROTECTED]> wrote:
> hi,
> This is the referrence about File::Find
> >use File::Find;
> >find(\&wanted, '/foo', '/bar');
> >sub wanted { ... }
> who can tell me the use of '/foo' and '/bar'?
> what are they ?
> Thank you!!
>
>
>
>
>
> --http://www.eyou.com
> --�ȶ��ɿ�����ѵ������� �����ʼ� �ƶ���ǩ
> ��������...�����
>
>
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
>
http://listserv.ActiveState.com/mailman/listinfo/activeperl
__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl