Maybe the problem is that you aren't checking exactly what you want to check... I'd suggest the following (full runnable code)

#!/usr/bin/perl use warnings FATAL => 'all'; use strict; my @cases = 1..19; for my $case ( @cases ) { if (eval { interesting($case) }) { eval { process($case); }; print "$case had processing errors: $@" if $@; } elsif ($@) { print "$case had interesting errors: $@"; } else { print "$case not interesting.".$/; next; } } sub interesting { my $case = shift; die "random failure on interesting" if rand() > 0.7; return rand()>0.5?1:0; } sub process { my $case = shift; print "doing something with $case".$/; die "random failure on process" if rand() > 0.7; }

Which gave me the following random output...

1 had interesting errors: random failure on interesting at /tmp/test.p +l line 21. 2 had interesting errors: random failure on interesting at /tmp/test.p +l line 21. doing something with 3 4 had interesting errors: random failure on interesting at /tmp/test.p +l line 21. 5 not interesting. 6 not interesting. doing something with 7 8 not interesting. 9 not interesting. doing something with 10 10 had processing errors: random failure on process at /tmp/test.pl li +ne 28. 11 not interesting. 12 not interesting. 13 not interesting. doing something with 14 14 had processing errors: random failure on process at /tmp/test.pl li +ne 28. 15 not interesting. 16 had interesting errors: random failure on interesting at /tmp/test. +pl line 21. 17 not interesting. doing something with 18 18 had processing errors: random failure on process at /tmp/test.pl li +ne 28. doing something with 19
daniel

In reply to Re: Unexpected action at a distance with use warnings FATAL=>'all'; by ruoso
in thread Unexpected action at a distance with use warnings FATAL=>'all'; by demerphq

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.