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


In reply to Re^3: Need help with Win32::TieRegistry by CrashBlossom
in thread Need help with Win32::TieRegistry by CrashBlossom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.