in reply to Re^4: get directory listing
in thread get directory listing

Your one liner is no longer really one line if you go that way. For the OP's solution, you'll need to be able to construct some magic looking glob string with '*' and '.*', and you'll have to weed out '.' and '..' as well. Assuming you can do that easily, you'll have something like this...

Fair enough! (++)

However in my experience (but YMMV too!) I've found that in the vast majority of cases you either want:

  1. files after some definite name pattern in a given directory (e.g.: 'log--*'), or
  2. all files in a given directory hierarchy. In which case I usually resort to plain File::Find, although its "enhanced" cousins would do.

Incidentally the "magic looking glob string" is nothing but '* .*'.