Home > Archive > PERL Beginners > March 2008 > Using File::Find module???
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Using File::Find module???
|
|
| Sanket Vaidya 2008-03-28, 4:13 am |
|
Hi all
I have some files stored in directory "resumes1" (say the files are file1,
file2 & file3).
When I run the following code
use warnings;
use strict;
use File::Find;
find (\&del,"D:/resumes1");
sub del
{
print "File name is $_\n ";
}
The output is:
File name is . (i.e. a dot)
File name is file1
File name is file2.
File name is file3
Where did this "." come from & how to eliminate it?
I use ActivePerl 5.10 on windows.
Thanks in advance.
| |
| Jeff Pang 2008-03-28, 4:13 am |
| On 3/28/08, sanket vaidya <sanket.vaidya@patni.com> wrote:
>
> Where did this "." come from & how to eliminate it?
>
'.' means the current directory.
to remove it, add a line at the begin of the callback function:
return if /^\.+$/;
|
|
|
|
|