On 18 Sep 2006 at 15:05, John W. Krahn wrote:
> Emilio Casbas wrote:
> > 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
> > this script show this;
> my $dir = '/tmp';
>
> opendir my $dh, $dir or die "Cannot open '$dir' $!";
>
> print "$dir\n",
> map !/\A\.\.?\z/ && -d "$dir/$_" ? "$dir/$_\n" : (),
> readdir $dh;
>
> John
That's looks nice John...but what is actually happening here. Some
sort of negation of \A (is that a character class?) and a directory
and/or something with a newline???
Could you help us mortals understand.
Thanx.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>