As you've probably noticed, Perl 5.036 is out.

While reading its delta (to decide what changes need to be done to Syntax::Construct), I noticed the following paragraph:

SIGFPE no longer deferred

Floating-point exceptions are now delivered immediately, in the same way as other "fault"-like signals such as SIGSEGV. This means one has at least a chance to catch such a signal with a $SIG{FPE} handler, e.g. so that die can report the line in perl that triggered it.

I tried to come up with code that triggers the Floating Point E{xception/rror} but I couldn't find any.

local $SIG{FPE} = sub { die "SIGNAL @_" }; my $x = 0; print 2 / $x;

I tried with sqrt -1, no difference. I asked on IRC and was given an example with Inline::C, but even that doesn't behave differently in the new Perl version:

#!/usr/bin/perl use warnings; use strict; use Inline 'C' => <<'__C__'; float killme() { volatile float f = 0.0; volatile float c = f / f; return c; } __C__ local $SIG{FPE} = sub { die "SIGNAL @_" }; print killme();

Can anyone provide an example that shows how the FPE signal is emitted and how its trapping is different in 5.36?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

In reply to FPE not deferred in 5.36 by choroba

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.