Hello TheloniusMonk,

Thanks for your feedback. Unfortunately adding BREAK to my list of signals still did not cause my code to trigger. The log is still empty after i close the window.

Updated Code which still does not trigger:
# partially based upon code by BrowserUK from https://www.perlmonks.or +g/?node_id=629210 use strict; use Config; use FindBin; use File::Spec; my $log_fn = File::Spec->catfile($FindBin::Bin, "cleanup_handler_log.t +xt"); my $LOG; open $LOG, '>>', $log_fn or die "Failed to open log '$log_fn' for appe +nding ($!)\n"; binmode $LOG; $LOG->autoflush(1); # disable buffering my @sigs = split ' ', $Config{ sig_name }; shift @sigs; print "SIGNALS: @sigs\n"; for ( @sigs ) { my $msg = "Signal $_ received\n"; $SIG{ $_ } = sub{ print $LOG $msg; warn $msg; }; } my $count; while( 1 ) { $count += 1 for 1.. 1e6; warn $count; sleep 3; }
The List of signals for which a signal handler is registered:
SIGNALS: HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 +PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD

In reply to Re^2: Window Close / Process Termination Handler on Windows by rminner
in thread Window Close / Process Termination Handler on Windows by rminner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.