From the Win32API::Registry documentation (the module that Win32::TieRegistry is built upon):

All calls return a true value for success and a false value for failure. After any failure, $^E should automatically be set to indicate the reason. However, current versions of Perl often overwrite $^E too quickly, so you can use regLastError() instead, which is only set by Win32API::Registry routines.
The error message that Perl most often overwites $^E with is "The system could not find the environment option that was entered".

Unfortunately, I haven't updated Win32::TieRegistry to document this nor to allow you to do use Win32::TieRegistry ( Delimiter=>"/", 'regLastError' ); so you'll have to add use Win32API::Registry qw( regLastError ); to your script and replace $^E with regLastError(). That will probably shed some light on the problem. If you have an old copy of Win32API::Registry, then you might have to update it.

I'd guess you are having a permissions problem. Win32::TieRegistry will try to open the key for read and write access and perhaps you only have read access (old versions of the module try to open keys for "all" access). You can try requesting read-only access instead (let us know if you have problems doing that).

A future version of TieRegistry will instead have a list of "open permissions" that defaults to ( "all", "read+write", "read-only" ) and will try those modes in sequence and only fail to open if all three attempts fail.

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

In reply to (tye)Re: TieRegistry problem...environment option ? by tye
in thread TieRegistry problem...environment option ? by uzzikie

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.