Title: Error Handling ?

Hello List,

I write some code to get process information from the remote machine, i am reading the machine names from a text file and then by loop calling a function and process each machine, somehow, if the machine is not exist, i got the error and script stoped, is there anyway to bypass error, like in vb we have 'on error resume next', i kow its not a good way, but right now i need something to bypass that, or i can chk the machine is up before running the function? the escript code where it give me error is follows:

1    my $Class="WinMgmts:{impersonationlevel=impersonate}!//$szServer";
2   
my $Wmi = Win32::OLE->GetObject ($Class);
3   
my @Processes = in ($Wmi->InstancesOf ("Win32_Process"));

the error i got is "Can't call method "InstancesOf" on an undefined value at Line 3.
Any help is Appreciated.
Thanks,

-Moin Khan

Reply via email to