September 25th, 2000, 10:23 PM
I've got a list of strings, by opendir
and i wanna check which of them are also directories,
is there any functions in Perl can check this?
I've tried these two methods, but it doesn't work......
print "$file is a directoryn" if -d $file;
@dir = grep -d, @files;
a million thanksssssssss
September 25th, 2000, 10:48 PM
>>if -d $file;
Make sure $file has a full server path.
September 26th, 2000, 12:04 AM
i.e. $file is a variable like
September 26th, 2000, 12:12 AM
Actually $file itself doesn't has to be full-server path, but you do need full server path for the -d, the directory test.
You can try something like this:
$mydir = "/home/myname/public_html";
Then test it -d $mydir/$file;