John W. Krahn wrote:
Emilio Casbas wrote:
Hi,

Hello,

I have this script;

-------
use File::Find;

$File::Find::no_chdir = 0;
find(\&wanted, @ARGV);

sub wanted {
       print "$File::Find::name\n" if(-d);
       }

-------

I want to do a directory search for a given ARG, but no a recursive
search, for example
my $dir = '/tmp';

opendir my $dh, $dir or die "Cannot open '$dir' $!";

print "$dir\n",
      map !/\A\.\.?\z/ && -d "$dir/$_" ? "$dir/$_\n" : (),
      readdir $dh;


This is that i was looking for, in a bit different way, but it works as expected.

Thanks to all.
Emilio C.

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