use warnings; use strict; use Data::Dumper; #changed the paths to office 12.0 (office 2007) values and the searched Key to "SharedTemplates" use Win32::TieRegistry( Delimiter => '#', ArrayValues => 0); my $pound = $Registry->Delimiter("/"); my $targetKey = $Registry->{"HKEY_CURRENT_USER/Software/Microsoft/Office/12.0/Common"} or die "Can't read the 'Common' key: $^E\n"; print STDERR "targetKey = '$targetKey'\n"; # this is the one you called "data" before. It's not data, it's another key my $generalKey = $targetKey->{"General"} # this is another subkey or die "Can't read the 'General' subkey: $^E\n"; print STDERR "generalKey = '$generalKey'\n"; # this is the one you called "data" before. It's not data, it's another key print STDERR Dumper $generalKey; # here, you can access actual values from the key, with or without a prefixed slash my $data = $generalKey->{'/SharedTemplates'} // ''; printf STDERR qq("%s" => >>%s<<\n), '/SharedTemplates', $data; my $noslash = $generalKey->{'SharedTemplates'} // ''; printf STDERR qq("%s" => >>%s<<\n), 'SharedTemplates', $noslash; my $dne = $generalKey->{'DoesNotExist'} // ''; printf STDERR qq("%s" => >>%s<<\n), 'DoesNotExist', $dne; $targetKey = $Registry->{"HKEY_CURRENT_USER/Software/Microsoft/Office/12.0/Common"} or die "Can't read the '12.0/Common' key: $^E\n"; print STDERR "targetKey = '$targetKey'\n"; # this exists in mine $generalKey = $targetKey->{"General"} or die "Can't read the '12.0/Common/General' subkey: $^E\n"; print STDERR "generalKey = '$generalKey'\n"; # this doesn't exist in mine, so it won't get here