in reply to How many levels of indirection in a Hash?

Pardon me if I am misunderstanding your question, but I think this seems to be what you are looking for. "Reparent" the hash based on the existance of a 'process' key one level deep; or, if the key 'process' exists in the hash, treat that key as the root.

use warnings; use strict; my %hash; $hash{three}{levels}{deep} = 7500; $hash{process}{three}{levels}{deep} = 9000; for my $process(qw/ process no_process /){ my $hashbase; if (exists $hash{$process}){ $hashbase = $hash{$process}; } else { $hashbase = \%hash; } print "$process - ",$hashbase->{three}{levels}{deep},"\n"; }