in reply to Problem pulling directories out of an array.

bkiahg,
I am guessing that it is because those are the only directories you have in $dirtoget. If you wanted to see files too you would not test with -d. See the following:
#!/usr/bin/perl -w use strict; my $dirtoget = './CSOC'; opendir( IMD , $dirtoget ) or die "Unable to open $dirtoget : $!"; for my $file ( readdir IMD ) { my $fqp = $dirtoget . '/' . $file; print -d $fqp ? "$fqp is a directory\n" : "$fqp is not a directory +\n"; }
Cheers - L~R

Update: Added $dirtoget to directory test as noted by other monks

Replies are listed 'Best First'.
Re: Re: Problem pulling directories out of an array.
by bkiahg (Pilgrim) on Feb 02, 2004 at 18:40 UTC
    Actually I'm spidering a directory and updating a web page and I needed a better way to tell between dir and files than the abscence of .abc The above code is what I needed. Thanks!