use Win32::API; Win32::API->Import( 'kernel32' => 'int SetErrorMode(int a)' ); SetErrorMode(2)