LKTee wrote on 25.05.2004:

>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.

print $File::Find::name, "\n" if $File::Find::name =~ /File1$/;

HTH,

Jan
-- 
Common sense is what tells you that the world is flat.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to