Difference between revisions of "Studio:How do I get Perl scripts to emit fatal errors when a COM error occurs?"

From STRIDE Wiki
Jump to: navigation, search
Line 6: Line 6:
  
  
[[Category:Scripting]]
+
[[Category:Perl Info]]
[[Category:Troubleshooting]]
 

Revision as of 11:10, 29 February 2008

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.