programming-examples/perl/Win32/New Registry Key Creation.pl
2019-11-15 12:59:38 +01:00

23 lines
684 B
Perl

use Win32::Registry ;
$key = "SOFTWARE\\newKey";
$HKEY_LOCAL_MACHINE->Open($key, $keyList);
print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
$keyList->GetKeys(\@subKeys);
$numberOfSubKeys = @subKeys;
print "\tThere is $numberOfSubKeys key\n";
foreach $subKey (@subKeys){
print "\t\t$subKey\n";
}
print "\nCreating the Perl6 Key\n";
$keyList->Create("Perl6",$newKeyList);
print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
$keyList->GetKeys(\@newSubKeys);
$numberOfSubKeys = @newSubKeys;
print "\tThere are now $numberOfSubKeys keys\n";
foreach $subKey (@newSubKeys){
print "\t\t$subKey\n";
}
$keyList->Close();
$newKeyList->Close();