Hi, after refer the File::Find, I write the script below:
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
find ( \&callback, "/") ;
sub callback{
print $File::Find::name, "\n";
}
but this script will list all the filename, from the disk. So, how I set the
condition, only display the same filename in the same directory? Anybody can
give me the solution? And your solution will appreciate.
-----Original Message-----
From: Tim Johnson [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:21 AM
To: LK Tee; [EMAIL PROTECTED]
Subject: RE: How to find files in subdirectory
Check the documentation for the File::Find module. It comes standard
with most Perl distributions.
-----Original Message-----
From: LK Tee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 6:52 PM
To: '[EMAIL PROTECTED]'
Subject: How to find files in subdirectory
Hi, I'm perls beginner now, I have a problem when create a script find
all file in subdirectory that have the same filename. How I write the
script using perl and return the result like below:
File1: ~/A/File1 ~/A/AA/File1 ~/A/C/CC/CCC/File1
Kuan.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>