Studio:How do I get Perl scripts to emit fatal errors when a COM error occurs?
By default, the Win32::OLE package in Perl, which allows Perl scripts to interact with COM objects, does not emit fatal errors when a COM error occurs. In order to get Perl scripts to emit fatal errors when a COM error occurs, include the following statement in your script:
Win32::OLE::Option(Warn => 3);
This would typically be placed near the top of the script. It is our recommendation that you always use Warn Level 3.