in reply to Re^2: Print inside SIGNALS
in thread Print inside SIGNALS

I'm on a Debian box as well, and the behaviour is like this:

If your C library's print function isn't re-entrant (many aren't), then there's always a chance that weird things happen when the signal goes off while your code is printing something.

Replies are listed 'Best First'.
Re^4: Print inside SIGNALS
by ikegami (Patriarch) on Jul 16, 2018 at 14:21 UTC

    If your C library's print function isn't re-entrant (many aren't), then there's always a chance that weird things happen when the signal goes off while your code is printing something.

    That's not true for two reasons:

    • print doesn't use clib.
    • Since Perl 5.8.1, signals are deferred to be handled between Perl ops.
      Thanks for the correction! The rule "don't print in signal handling" stuck with me for too long, I should have checked this.