in reply to Directory Stuff

readdir() returns just the NAME of the file, not the PATH! Therefore if you

opendir DIR, $path
you have to
open THEFILE, "< $path/$file" or die "Can't open $path/$file: $!\n";

HTH, Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature