in reply to TieRegistry save/load

Use Storable

Update:
Untested code below:Ok, I went back and tested it.

#!perl use Diagnostics; use strict; use warnings; use Win32::TieRegistry; use Data::Dumper; use Storable; my $key = $Registry->{ "HKEY_CLASSES_ROOT\\.pl\\" }; print Dumper( $key ); store $key, "foo.bar"; #write to a file my $read_key = retrieve( "foo.bar" ); #read it back print Dumper( $read_key ); $Registry->{"HKEY_CLASSES_ROOT\\.pl\\" } = $read_key;

Update2:
Added the last line to write the retrieved values to the registry.


<cite>Just a tongue-tied, twisted, earth-bound misfit. -- Pink Floyd</cite>

Replies are listed 'Best First'.
Re: Re: TieRegistry save/load
by markmm (Initiate) on Feb 28, 2002 at 18:51 UTC
    I tried the code, modified it a little bit to match my registry, Problem is that if I delete 1 of the subkeys, for example: HKEY_LOCAL_MACHINE\SOFTWARE\Canon\PowerShot\PSLL\601 out of the registry, and I run the retrieve, it does not create the entry, it seems to ignore the keys that are not in the tree.
Re: Re: TieRegistry save/load
by markmm (Initiate) on Feb 28, 2002 at 19:20 UTC
    I tried the code, modified it a little bit to match my registry, Problem is that if I delete 1 of the subkeys, for example: HKEY_LOCAL_MACHINE\SOFTWARE\Canon\PowerShot\PSLL\601 out of the registry, and I run the retrieve, it does not create the entry, it seems to ignore the keys that are not in the tree. This is also true if I modify a subkey. Any suggestions?