Hi:
If I need to get the files without the "." and the ".." at the first level
only, then how can i modify the find command?
ie
Currently using find(sub {push(@new,$_) if ( -f ) }, $path); gives me all
files under NewDir as well as NewSubDirectory
C:\build\Sample\NewDir\File1.txt
C:\build\Sample\NewDir\File2.txt
C:\build\Sample\NewDir\NewSubDirectory
C:\build\Sample\NewDir\NewSubDirectory\11.txt
C:\build\Sample\NewDir\NewSubDirectory\12.txt
If I need to get files only under NewDir and then issue another command to
get files only under NewSubDirectory, then how can i restrict the find
command to only look for the files under the directory mentioned
i.e.
perl <progname>.pl C:\build\Sample\NewDir will only give
File1.txt
File2.txt
and
perl <progname>.pl C:\build\Sample\NewDir\NewSubDirectory will give
11.txt
12.txt
Thanks again!
-Nishi.
On 7/22/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Wagner, David --- Senior Programmer Analyst --- WGO" schreef:
> if ( !/^\.{1,2}/ )
That would fail "..x" &c.
If you are only interested in files and not directories, use -f.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>