On Monday, February 4, 2002, at 07:26 PM, Jeff 'japhy' Pinyan wrote:
> On Feb 4, david wright said: > >> i am sending @array a directory (i.e. example /usr/dw5) which >> contains a >> lot of files and folders (directories). > > Be warned that readdir() returns NAMES, not PATHS. > > opendir DIR, "/some/dir"; > @files = readdir DIR; > closedir DIR; > > @files will contain (".", "..", "file1", "blah", ...). Notice how those > names do NOT have "/some/dir/" at the beginning? > > for (@files) { > print "$_ is ok\n" if -d "/some/dir/$_"; > } > > -- > Jeff "japhy" Pinyan [EMAIL PROTECTED] > http://www.pobox.com/~japhy/ > RPI Acacia brother #734 http://www.perlmonks.org/ > http://www.cpan.org/ > ** Look for "Regular Expressions in Perl" published by Manning, in > 2002 ** > <stu> what does y/// stand for? <tenderpuss> why, yansliterate of > course. > > Damn it, now it makes sense, exactly,... it's just reading a "string" it doesn't know what it's representing, that's why i have to chdir. (Guess that answers my question of my i would have to chdir if i can readdir ;-) ) excellent! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]