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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |