in reply to If question

The first problem is that this code is a syntax error. You couldn't even compile this could you? The reason is simple:
if ($condition) { #code }; # <-------- semicolon is syntax error elsif ($condition) { #code }
I dont like this indent style much because of this type of problem.(I'm a cuddeled else man myself, I don't like 'em lonely :-) Change it to:
if ($condition) { #code } elsif ($condition) { #code }
Of course as suaveant said you'll also have to change your regex syntax.
foreach (@vals) { $SubKey->GetValues(\%cvalues); if ($cvalues{'Server'}[2] =~/NT-PRINT1/) { print "something\n"; } elsif ($cvalues{'Server'}[2] =~/NT-PRINT2/) { print "another thing\n"; } }

You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)