Actually, it is a feature of how Perl's global destruction is not done in an orderly manner in order to save time. Whether or not you get the error depends on some rather random things.

I don't see how not using -w would help as trying to call a method on an undefined value does not require -w in order to trigger. Perhaps you are just getting lucky.

You don't have to upgrade Perl to solve this problem. Simply upgrade Win32::TieRegistry. If you go to http://search.cpan.org/ and search for "TieRegistry", you'll find version 0.24. Click on the very first link and then click on the Changes file to see:

Revision history for Perl extension Win32::TieRegistry.

0.24  2001-02-06 19:00
        - Silenced error that could appear "at random" during "cleanup":
                (Can't call method "FETCH" on an undefined value)
(Well, when I did that I got an error which I'm hoping is a temporary problem with the web site.)

In any case, I was able to download the module. Then unzip the file and install it like any CPAN module (or, if you don't have a version of "make", run the included Install.bat). The latest version may also be available in PPM form from some repository (I don't keep track much since I don't seem to have the ability to affect what gets made available).

As for the error being harmless, you are mostly correct. The only thing related to that error that is a problem is fairly minor, especially considering that it only affects a feature that is rarely used. From the Bugs section of manual:

Current implementations of Perl's "global destruction" phase can cause objects returned by Load() to be destroyed while keys within the hive are still open, if the objects still exist when the script starts to exit. When this happens, the automatic UnLoad() will report a failure and the hive will remain loaded in the Registry.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Win32::tieRegistry question by tye
in thread Win32::tieRegistry question by chinman

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.