#!/usr/bin/perl use strict; use warnings; my $top_dir = "C:/Documents and Settings/Owner/My Documents/My Pictures"; $top_dir = $top_dir . "/ACK_Kenya_2008/"; opendir(THISDIR,$top_dir) || die "$0: Can't open directory '$top_dir': $!\n"; my @file_list = readdir(THISDIR); # slurp in all directory entries closedir(THISDIR) || die "$0: Can't closer current directory '.': $!\n"; my $tot_count = 0; my $line = " PICTURES\n"; foreach my $this_file (@file_list) { next if($this_file =~ /^\.{1,2}$/); # ignore the . and .. entries my $file = $top_dir . $this_file; # be sure to use file with full path name if(-d $file) { print "$this_file is a directory\n"; } # end if } # end foreach $file loop exit(0);