The English of what I want to do is "If this remote value is not defined, then skip over it and proceed on to the next entry in the list."
I want to avoid an error is the key doesn't exist. Every variation of IF EXISTS I use doesn't work correctly. Is there something obvious I am missing? foreach $server (@servers) { $sMachineName = $server; my $sKeyPath = "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\ "; my $remoteKey = $Registry->Connect( $sMachineName, $sKeyPath) or print "Can't connect to $sMachineName or can't open subkey:$^E\n"; # <--This is the line I am having problems with print "$server \n"; print $remoteval; print "------------------------ \n"; }