http://www.perlmonks.org?node_id=1046711


in reply to Press enter to exit

A modification to kcott's case 1:

This will always prompt you to press enter, no matter how the script exits, even if an error is encountered.
This can be useful if the script is running in its own window which closes when the script exits.
use strict; use warnings; # ... my $x = 1 / 0; # ... END { print "\nHit enter when done: "; <>; exit; }
Output:
Illegal division by zero at D:\stuart\play\temp\pp.pl line 6. Hit enter when done: