I have a laptop running WinXP and non-clustered server running Wndows 2008 R2 Enterprise (64-bit). Both are running ActiveState Perl, v5.12.4 on the laptop; v5.8.something on the server. (Sorry I can't be more precise, I failed to capture that data when I was on the server and can't re-connect to it right now.) On my laptop, the following runs just fine, showing the keys under each path:
my $hKey; foreach my $path ("SOFTWARE", "SOFTWARE\\Microsoft", "SOFTWARE\\Microsoft\\Microsoft SQL Server", "SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names",) { warn "path = $path\n"; $::HKEY_LOCAL_MACHINE->Open($path, $hKey) or die $^E; my @array; $hKey->GetKeys(\@array); warn join(', ', @array), "\n"; }
On the server, the first three paths work, but the third one doesn't show an Instance Names key and the last path returns a "not found" error. If I fire up regedit or regedt32, then all of the paths are present, but there are differences in the displayed sub-keys; the most notable is that the Instance Names key exists but the script shows, for example, the ActiveState key under the top level SOFTWARE path, but regedit doesn't; furthermore, using regedit's Find function doesn't find an ActiveState key anywhere. I can't figure out what's going on. Can anyone please help?

UPDATE: Re-writing to use Win32::TieRegistry did nothing. Upgrading the server to use ActiveState Perl 5.16.1, however, fixed everything.


In reply to Win32::Registry not working by samwyse

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.