$Bill Luebkert wrote:
>>
>>use strict;
>>use warnings;
>>use Win32::Registry;
>>
>>my $Host = $ENV{COMPUTERNAME};
>>my $Key;
>>my $KeyName = "SYSTEM\\CurrentControlSet\\Enum";
>>print "INFO: Test if \"$KeyName\" on $Host exists and is readable\n";
>>if (! $HKEY_LOCAL_MACHINE->Open( $KeyName, $Key ) ) {
>>   print "\"$KeyName\" does not exist or is not readable on $Host\n";
>>} else {
>>   print "\"$KeyName\" on $Host exists and is readable\n";
>>}
>>$Key->Close() or warn "Could not close \"$KeyName\" on $Host\n" if
>>defined $Key;
>
>
> Works for me.

Great!

>
> PS: You can avoid the ugly escaping if you use single quotes or qq :
>
> print "'$KeyName' does not exist or is not readable on $Host\n";
> print qq{"$KeyName" does not exist or is not readable on $Host\n};
>

Yep, I know. But it doesn't look as pretty in the source ;-)

Alex
_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to