The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Win32::Die - Dying gracefully under Win32


        use Win32::Die;

        die "Hello world";


Windows automatically ("helpfully") closes DOS windows when they quit. This can be annoying when your Perl program dies, since you don't get a chance to read the error message. Win32::Die detects if your program was double-clicked, or run from a command line, and alters %SIG{__DIE__} appropriately. The DOS window remains put until you close the window or hit a key.


If another module attempts to catch __DIE__ exceptions, then using Win32::Die may cause fatal errors. But there are different methods of accomplishing the same effect. Depending on your situation, one of these methods might be a better solution.



Alex Vandiver

Maintained by Mike Accardo <>


This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License