Hi,

" It seems that if it hits the timeout value in the if eval statement it does not proceed"

Well, it does nothing further in the outer if block shown ... impossible to see from what you posted what happens after it. The behaviour is apparently by design because essentially the block says:

if ( $outer_cond ) { if ( eval { func(); 1 } ) { do_something(); } }

I would start by adding an else block to the inner if block and printing some debugging from there if hit. It would be most helpful to print the error message if present; you could just use:

else { say "ERR $@"; }
... but I would replace the eval with Try::Tiny as it's so easy to do and so much better. Something like:
use Try::Tiny; if ( $outer_cond ) { my $ok = try { func(); 1; # not needed if func() returns something on success } catch { say "ERR $_"; 0; }; $ok ? do_something() : do_something_different(); }

Hope this helps!

updated: to show better program flow


The way forward always starts with a minimal test.

In reply to Re: If unsuccessful action (updated) by 1nickt
in thread If unsuccessful action by fasteddye

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.