I am working my butt off trying to get eval blocks working. When I run a pert of perl code, if the code fails I dont want the script to terminate. Here is what I am talking about:
If this chunck of code does not work, or spits out an error then I want to script to continue. What am I doing wrong?
Thanks
-T
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!
Code:
use Win32::Registry;
eval{
my ($node) = '\\\\ComputerName';
my ($hNode, $hKey, %values);
$HKEY_LOCAL_MACHINE->Connect ($node, $hNode) || warn "Cannot connect to $node";
$hNode->Open ("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", $hKey)|| warn "Cannot open registry !";
$hKey->GetValues (\%values);
$hKey->Close ();
$hNode->Close ();
print $values{ProductName}[2] . "\n";
print $values{CSDVersion}[2];
};
Thanks
-T
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!