I don't know if this is your problem, but you should really be using 'eq' instead of '==' when comparing strings.
-----Original Message----- From: henry isham [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 9:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Win32::TieRegistry misbehaving All, I'm experiencing some weird behavior with Win32::TieRegistry. The code below yields 2 different results when run on Win2K and NT4. On Win2K, when if (($value == "changeme")) is evaluated, it's always found to be true as long as $value is non-null. On NT, when if ( $value == $cn ) {die "Machine already configured properly.\n"} is evaluated, it's always found to be true as long as $value os non-null. So, on NT, the script always dies at if ( $value == $cn ) {die "Machine already configured properly.\n"} without further processing, even though they're NOT equal. What gives? Has anyone seen this before? Am I missing something here? Your help is much appreciated. -Henry use Win32::TieRegistry; my $value; my $cn; $cn = $Registry->{"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Compute rName\\ActiveComputerName\\\\ComputerName"}; #$ENV(COMPUTERNAME); print "computer name is ".$cn."\n"; $value= $Registry->{"HKEY_LOCAL_MACHINE\\Software\\Citrix\\ICA Client\\\\ClientName"}; if (!($value)) {die "No value found.\n"} if ( $value == $cn ) {die "Machine already configured properly.\n"} if (($value == "changeme")) { print "previous value ".$value."\n"; $Registry->{"HKEY_LOCAL_MACHINE\\Software\\Citrix\\ICA Client\\\\ClientName"} = $cn; $value= $Registry->{"HKEY_LOCAL_MACHINE\\Software\\Citrix\\ICA Client\\\\ClientName"}; print "new value ".$value."\n"; #die "Citrix client name is not changeme. It is currently set to $value.\n" } = Z)fyXXh韧`驚)Ŋlzr桴y+Z(:.崞˛ mm+-失〢bj摴oj)fj㹲˛ _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
