Also: use strict; use warnings;
and don't forget to put in some else statements to go with your ifs. -----Original Message----- From: Kipp, James [mailto:James.Kipp@;mbna.com] Sent: Friday, November 01, 2002 9:31 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: Win32 - Problem updating the registry maybe try putting some die or warn statements to hopefully give you a clue as to what went wrong. or check to see it Win32::Registry has any error status functions ----Original Message----- > From: [EMAIL PROTECTED] [mailto:gkhgkh@;attbi.com] > Sent: Friday, November 01, 2002 12:22 PM > To: [EMAIL PROTECTED] > Subject: Win32 - Problem updating the registry > > > I am trying to update the Registry using a script from > David Roth's book Win32 Perl Programming. The script > appears to run, no errors, however the Key does not get > added to the registry. > > Any help is appreciated. > > Thanks > > #!/perl/bin/perl -w > use strict; > > use Win32::Registry; > > my $Path = 'Software\Microsoft\Office\9.0\Word\Options'; > my $ValueName = "AutoSave-Path"; > my $Key; > > if ($HKEY_CURRENT_USER ->Open($Path, $Key)) { > my($DataType, $Data); > if ($Key->QueryValueEx($ValueName, $DataType, > $Data)) > { > if ((REG_SZ == $DataType) || (REG_EXPAND_SZ == > $DataType)) { > #$Data =~ s/^c:/d:/i; > $Key->SetValueEx($ValueName, 0, REG_DWORD, > 1); > } > } > } > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]