Sioln has asked for the wisdom of the Perl Monks concerning the following question:

I need to clone registry node from one host to other. But after this code all keys are in type REG_SZ but not their original. I don't understand why. All structured transfered normaly, subnodes, keynames, types(and depending values)

use Win32::TieRegistry; my $SOURCE=$Registry->Connect( '127.0.0.1','LMachine',{Delimiter=>"\\" +}) or die; my $REMOTE=$Registry->Connect( 'bdc','LMachine',{Delimiter=>"\\"}) or +die; my $folder="SYSTEM\\RAdmin\\"; $REMOTE->{$folder}=$SOURCE->{$folder} or die; or $REMOTE->{$folder}=$SOURCE->{$folder}->Clone() or die;

Replies are listed 'Best First'.
Re: Win32::TieRegistry cloning keys bug. (ArrayValues)
by tye (Sage) on Jan 17, 2006 at 14:59 UTC

    Quoting the f' documentation:

    Note that you need to have called $Registry->ArrayValues(1) for the proper value data type information to be copied. Note also that this release of Win32::TieRegistry does not copy key attributes such as class name and security information

    - tye        

      I've read about $Registry->ArrayValues(1), but

      $Registry->ArrayValues(1) or die;# - dead $SOURCE->ArrayValues(1) or die;# - dead $DESTINATION->ArrayValues(1) or die;# -dead
      How can I use it ?

        Perhaps you should consider reading the documentation for it?

        ArrayValues

        $oldBool= $key->ArrayValues

        $oldBool= $key->ArrayValues( $newBool )

        Gets the current setting of the ArrayValues option and possibly turns it on or off.

        So I'm not sure why you feel "the current setting" being false justifies dieing.

        - tye