I was using TieRegistry.pm and I kept getting an error from within the subroutine SubKeyNames. It related to returning a null hash (iirc). the hash was to have been generated and returned by _enumSubKeys. In single stepping through that code, I found that it was returning prematurely from the routine due to:
if( ! _NoMoreItems() ) { return (); }
Looking at that code, it appeared there was an assumption that an error would be generated by the call to RegEnumKeyEx (specifically, that it would be ERROR_NO_MORE_ITEMS) when there were no more subkeys. In single stepping this code, I saw that there was no error...the call to Errnum was returning zero. Modifying the code to NoMoreItems to check for either $_NoMoreItems or zero
sub _NoMoreItems { my $rval; return $_NoMoreItems =~ /^\d/ ? (_ErrNum() == $_NoMoreItems || _ErrNum() == 0) : _ErrMsg() =~ /$_NoMoreItems/io; }
eliminated the error and allowed the code to return data as expected. if this is expected, the change would have to be augmented to deal with a "no error" message as well. Has anyone know if there was an interface change for RegEnumKeyEx that resulted in it returning no error after processing the last subkey? gratz.

In reply to Problem with TieRegistry.pm on windows xp/cygwin by myoung5655

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.