I tried your sub, but it still does not work. ".:Permission denied at project6.pl line 16." Which is open FIN,"< $fname" or die "$fname:$!"; Any idea why this happens?
If you read the diagnostic carefully you'll notice it complains about the filename "." which is actually your current working directory. You forgot the line
next if ($file eq '.') || ( $file eq '..');
just prior to the call to the sub. I think I mentioned that a few answers ago...
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg