----- Original Message -----
From: "Jorge Goncalvez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 4:00 AM
Subject: Re: Re:What's wrong with this?


> it still not working i tried this:
> use Win32::Registry;
> my $Register ="Software";
> my $Register2=".DEFAULT\\Software";
> my $hkey;
> $HKEY_LOCAL_MACHINE->Open($Register,$hkey)|| die $!;
> $hkey->DeleteKey("Cygwin2");
> $hkey->Close();
> $HKEY_CURRENT_USER->Open($Register,$hkey)|| die $!;
> $hkey->DeleteKey("Cygwin2");
> $hkey->Close();
> $HKEY_USERS->Open($Register2,$hkey)|| die $!;
> $hkey->DeleteKey("Cygwin2");
> $hkey->Close();

Well, I am not familiar with this module, and your Open IS correct after looking at it 
on CPAN.
This is just a guess (not even sure if you can create a hash [%rkey] like this...), 
but give it a
try.  CPAN states that this module is obsolete and to use Win32:TieRegistry instead...

Shawn

use strict;
use Win32::Registry;
my $Register ="Software";
my $Register2=".DEFAULT\\Software";
my $hkey;
my $delete='Cygwin2';
my %rkey(
  $HKEY_LOCAL_MACHINE=>$Register,
  $HKEY_LOCAL_MACHINE=>$Register,
  $HKEY_USERS=>$Register2
  );
for($HKEY_LOCAL_MACHINE,$HKEY_CURRENT_USER,$HKEY_USERS) {
  $_->Open($rkey{$_},$hkey)|| die $!;
  $hkey->DeleteKey($delete);
  $hkey->Close();
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to