sub checkPathPermissions { my( $path, @bits ) = split '[/\\]', shift; $path = '/' . $path; while( @bits ) { print STDERR "$path: ", join ' : ', stat( $path ); $path .= '/' . shift @bits; } }