my $objectWhenceFindPath; $objectWhenceFindPath->{here}->{an}->{hypothetical}->{path} = "some value"; my @path = ("an", "hypothetical", "path"); my $currentPath = $objectWhenceFindPath->{here}; for my $index (0 .. ($#path - 1)) { $currentPath = $currentPath->{$path[$index]}; # Some logic, or not. Depend of script. } $currentPath ++;