dvergin has asked for the wisdom of the Perl Monks concerning the following question:
Following advice here I am using File::Glob's bsd_glob() to grab directory listings. But I now discover that on my Linux 7.3 system both glob() and bsd_glob() ignore dot files (like .bashrc .vimrc etc.). Here's a demo:
But the files beginning with a dot are not listed. I need them. I'm using the File::Glob module for its handling of spaces in directory names and I am using bsd_glob() following the advice in response to my previous post mentioned above.#!/usr/bin/perl use warnings; use strict; use File::Glob ':glob'; my @ary = bsd_glob( "/home/dvergin/*" ); #my @ary = glob( "/home/dvergin/*" ); # same result print "[$_]\n" for @ary;
How do I get graceful handling of spaces in dir names and glob-ish lists of directory contents that include the dot files?
------------------------------------------------------------
"Perl is a mess
and that's good because the
problem space is also a mess." - Larry Wall
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File::Glob Ignores Dot Files
by Paladin (Vicar) on Nov 25, 2003 at 18:45 UTC | |
by iburrell (Chaplain) on Nov 25, 2003 at 19:57 UTC | |
by Anonymous Monk on Aug 31, 2007 at 20:13 UTC | |
Re: File::Glob Ignores Dot Files
by Anonymous Monk on Nov 25, 2003 at 18:43 UTC | |
Re: File::Glob Ignores Dot Files
by Aristotle (Chancellor) on Nov 26, 2003 at 11:10 UTC | |
by jrw (Monk) on Sep 13, 2013 at 18:41 UTC | |
by Aristotle (Chancellor) on Dec 30, 2013 at 20:22 UTC | |
Re: File::Glob Ignores Dot Files
by Zed_Lopez (Chaplain) on Nov 25, 2003 at 18:45 UTC | |
by ZdrozZ (Scribe) on Nov 26, 2003 at 10:09 UTC |
Back to
Seekers of Perl Wisdom