On 18 Sep 2006 at 15:43, David Romano wrote: > Beginner wrote on Mon, Sep 18, 2006 at 03:24:08PM PDT:
> > > 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??? > perldoc perlretut > > The map section is making sure the return value from readdir isn't the > special '.' or '..' directories (the regex portion), and making sure the > return value from readdir is an actual directory and not a file. For > every return value from readdir, "$dir/$_\n" is printed if it is a > directory, otherwise nothing. > I can find a reference to a character class \A, am I being blind here! As for the map function, I can't be reading this right; I see a regex followed by some tests 1) "not an \A" followed by a literal dot and another dot ( 0 or 1 times??) and a literal 'z' and 2) $dir/$_ is a directory or is a directory with a newline or is empty while passing the contents or readdir. I could use a little clarification on ? and : as well. I am not saying it's won't work, only that I can't understand it. Sorry if I'm being dump. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>