in reply to Read only Files in a Directory

#### Need to keep this code unchanged opendir DIR, "Whatever/path"; @files=grep { !/^\.+$/ } readdir(DIR); closedir DIR;
Your comment is wrong, you definitely need to change that code.
#### Need to keep this code unchanged opendir DIR, 'Whatever/path' or die "Cannot open 'Whatever/path' $!"; my @files = map "Whatever/path/$_" grep !/\A\.\.?\z/, readdir DIR; closedir DIR;

Replies are listed 'Best First'.
Re^2: Read only Files in a Directory
by johngg (Canon) on Aug 01, 2006 at 23:12 UTC
    my @files = map "Whatever/path/$_" grep !/\A\.\.?\z/, readdir DIR;
    I might be wrong but don't you need a comma in map EXPR, list. If so, that line should be

    my @files = map "Whatever/path/$_", grep !/\A\.\.?\z/, readdir DIR;

    Cheers,

    JohnGG

      Oops, thanks for fixing that.   :-)
      It worked for me too. Thanks. Just changed the "Whatever/path/$_" as "$_" Thanks