#!/usr/bin/perl opendir (ID, "/home/actionet/gallerymain") || print "Couldn't open directory for reading\n"; (@dir0) = readdir(ID) || print "Couldn't read directory contents.\n"; closedir(ID) || print "Couldn't close directory after reading contents\n"; foreach $inode0 (@dir0) { print "File about to be processed is: $inode0\n"; next if ($inode0) =~ /^\./; $thefile = "/home/actionet/gallerymain" . $inode0; next if (-d $thefile); print "File to process is: $thefile\n"; }