in reply to Re: Permission denied Found to be Obsolete
in thread Permission denied Found to be Obsolete

All correct and I have added the the comment "below is the orginal line 13" However I now have the answer.

And its in the checking of the directory. It should read
if($file ne '.' and $file ne '..' and ! (-d $dir.$file)){ ##code }

A trap I should have seen I admitt but sometimes putting on here clears ones head.

Replies are listed 'Best First'.
Re^3: Permission denied Found to be Obsolete
by jdporter (Paladin) on Sep 26, 2006 at 14:30 UTC
    !(-d $name)
    should be
    -f $name

    After all, there's plenty of things a directory entry can be besides a plain file and a directory.

    You should probably also consider whether the name test shouldn't instead be

    $file !~ /^\./
    because, theoretically, any file whose name begins with dot is supposed to be "hidden". Of course, you may in fact want to search the hidden files as well; I don't know.

    We're building the house of the future together.