in reply to View hidden files?

glob doesn't list "." files unless you ask it to.
my @files = <$dir/.* $dir/*>;

You'll have fewer problems if you use bsd_glob directly.

use File::Glob qw( bsd_glob ); my @files = ( bsd_glob("$dir/.*"), bsd_glob("$dir/*") );

Replies are listed 'Best First'.
Re^2: View hidden files?
by Tanktalus (Canon) on Dec 14, 2008 at 22:19 UTC

    Doesn't glob just call File::Glob::bsd_glob (by default) anyway?

    my @files = glob "$dir/{,.}*";
    Works fine for me :-)

    Update: I should finish reading the docs... apparently, glob still splits on space, though I'm not sure why.

Re^2: View hidden files?
by sito (Initiate) on Dec 14, 2008 at 18:13 UTC
    Thanks, you first code worked perfectly.
      Only as long as you don't try to list a dir that has a space in its name. The second executes the same code, but doesn't treat spaces specially.