Win32::OLE->Option(Warn => 3); is equivalent to Win32::OLE->Option(Warn => \&Carp::croak); This can even be used to emulate the VisualBasic "On Error Goto Label" construct: Win32::OLE->Option(Warn => sub {goto CheckError}); # ... your normal OLE code here ... CheckError: # ... your error handling code here ... #### F:\_wo\pl_test>perl 696125.pl Win32::OLE(0.1701) error 0x80041002 after character 0 in "winmgmts:{impersonationlevel=impersonate,(Backup,Restore)}\\localhost\root\wmi:BcdStore" at 696125.pl line 14 eval {...} called at 696125.pl line 14 Can't call method "OpenStore" on an undefined value at 696125.pl line 16.