Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Win32::TieRegistry Error (or is it me?) (leads)

by ChrisR (Hermit)
on Sep 27, 2005 at 02:57 UTC ( [id://495254]=note: print w/replies, xml ) Need Help??


in reply to Re: Win32::TieRegistry Error (or is it me?) (leads)
in thread Win32::TieRegistry Error (or is it me?)

I was pretty sure that it wasn't the upgrade but that was the only that changed.

Here's what I did:

eval { @regValues = $fieldKey->ValueNames; }; print "\$\^E: $^E\nregLastError: " . Win32API::Registry::regLastError( +) ."\n\n";
The program did not die and here's what was printed:
$^E: regLastError: No more data is available
Without the eval:
@regValues = $fieldKey->ValueNames; print "\$\^E: $^E\nregLastError: " . Win32API::Registry::regLastError( +) ."\n\n";
the program dies and prints this:
$^E: No more data is available regLastError: No more data is available Can't use an undefined value as an ARRAY reference at C:/Perl/site/lib +/Win32/TieRegistry.pm line 684, <DATA> line 164.
However, I may not have used eval correctly or as you intended. If not let me know and I'll do it again.

Thanks,
Chris

Replies are listed 'Best First'.
Re^3: Win32::TieRegistry Error (or is it me?) (leads)
by tye (Sage) on Sep 27, 2005 at 03:01 UTC

    Okay, that makes it look like Win32::WinError got changed. What does this produce?

    perl -MWin32::WinError -le"print Win32::WinError::constant("ERROR_NO_M +ORE_ITEMS",0)" perl -MWin32::WinError=999 -e0

    - tye        

      perl -MWin32::WinError -le"print Win32::WinError::constant("ERROR_NO_M +ORE_ITEMS",0)"
      Prints 0
      perl -MWin32::WinError=999 -e0
      Prints nothing.

        That looks very broken. Can you investigate Win32::WinError? What changed about it? For example:

        perl -MWin32::WinError -le"print for $INC{'Win32/WinError.pm'}, $Win32 +::WinError::VERSION"

        In the mean time, you can edit TieRegistry.pm to make it no longer rely on Win32::WinError:

        #if( eval { require Win32::WinError } ) { # $_NoMoreItems= Win32::WinError::constant("ERROR_NO_MORE_ITEMS",0) +; # $_FileNotFound= Win32::WinError::constant("ERROR_FILE_NOT_FOUND", +0); # $_TooSmall= Win32::WinError::constant("ERROR_INSUFFICIENT_BUFFER" +,0); # $_MoreData= Win32::WinError::constant("ERROR_MORE_DATA",0); #} else { $_NoMoreItems= "^No more data"; $_FileNotFound= "cannot find the file"; $_TooSmall= " data area passed to "; $_MoreData= "^more data is avail"; #}

        Comment out those lines as shown above.

        - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://495254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found