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 ...