jjdraco has asked for the wisdom of the Perl Monks concerning the following question:
im currently trying to teach myself perl, i'm working on a script to read a given directory and rename all the files in the directory to the format dir####.ext where dir is the directory name and #### is 0000 through 9999. i've read the list of files in to an array called @file_list but i wanted to filter out any directory, which i was able to do, however i ran across a problem, there was a hidden file in the directory, and i don't want to rename it, i found a way to not rename this file, but i would prefere a more generalized way of doing this, my code for reading the directory is this
@file_list= grep {!/Thumbs.db/ && -f "$_" } readdir(DIR);
is there away to just filter hidden files?
thanks for the help
jjdraco
@file_list= grep {!/Thumbs.db/ && -f "$_" } readdir(DIR);
is there away to just filter hidden files?
thanks for the help
jjdraco
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: filtering hidden files on Win32
by BrowserUk (Pope) on Aug 30, 2002 at 10:36 UTC | |
Re: filtering hidden files on Win32
by Mr. Muskrat (Canon) on Aug 30, 2002 at 16:38 UTC | |
by (anonymized user) (Curate) on Jan 14, 2016 at 13:36 UTC |
Back to
Seekers of Perl Wisdom