in reply to Re^2: Need help with Win32::TieRegistry
in thread Need help with Win32::TieRegistry

After reading holli's observation that SystemInfo uses TieRegistry, I took look at the source for SystemInfo. The following bit at the top is lifted almost verbatim from SystemInfo:
use strict; use warnings; use Win32::TieRegistry qw(:KEY_); $Registry->Delimiter("/"); my $procinfo = $Registry->Open( "HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/Centra +lProcessor/0", { Access => KEY_READ() } ); PrintHash($procinfo); sub PrintHash { my ($hashref, $indent) = @_; my %hash = %{$hashref}; $indent += 2; my $maxsize = 0; foreach my $key (keys %hash) { $maxsize = length $key if (length $key > $maxsize); } foreach my $key (sort keys %hash) { printf "%*sKey: %-*s Value: %s\n", $indent, "", $maxsize, $key +, $hash{$key}; if (ref $hash{$key} eq 'ARRAY') { PrintArray($hash{$key}, $ind +ent); } if (ref $hash{$key} eq 'HASH') { PrintHash($hash{$key}, $inde +nt); } } } sub PrintArray { my ($array, $indent) = @_; my @arr = @{$array}; $indent += 2; my $cnt = 0; foreach my $elem (@arr) { printf("%*s%2d. %s\n", $indent, "", $cnt, $elem); if (ref $elem eq 'ARRAY') { PrintArray($elem, $indent); } if (ref $elem eq 'HASH') { PrintHash($elem, $indent); } ++$cnt; } }
Here is the result:
Key: /Component Information Value: Key: /Configuration Data Value:          Key: /FeatureSet Value: 0x3D1B3FFF Key: /Identifier Value: Intel64 Family 6 Model 60 Ste +pping 3 Key: /Platform Specific Field 1 Value: 0x00000020 Key: /Previous Update Revision Value:  Key: /ProcessorNameString Value: Intel(R) Core(TM) i7-4700HQ C +PU @ 2.40GHz Key: /Update Revision Value: % Key: /Update Status Value: 0x00000000 Key: /VendorIdentifier Value: GenuineIntel Key: /~MHz Value: 0x0000095A

Apparently "Access => KEY_READ()" indicates that read-only access is requested, which makes everything good.

Thanks for the responses. This issue is resolved