hello,
thanks for your help!
But the code doesn't work!
It outputs nothing.
----------origin------------------------------------
From: Jim Angstadt[SMTP:[EMAIL PROTECTED]]
Sent: Monday, October 23, 2000 11:15 AM
To: ����; [EMAIL PROTECTED]
Subject: Re: a problem about File::Find
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
--http://www.eyou.com
--�ȶ��ɿ�����ѵ������� �����ʼ� �ƶ���ǩ ��������...����δ��
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl