if(defined($tmphash->{$part})) { # Does the part exists in the hash-tree? if($i == @parts-1) { # Is this the last part of the path? $found=1; # Yes, the folder is in the database! } else { # Not the last part of the path $tmphash=$tmphash->{$part}; # Go one level further } } else { last; # The path is not in the database }