http://www.perlmonks.org?node_id=1030206


in reply to die through several evals

Why do you need nested evals?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: die through several evals
by Anonymous Monk on Apr 23, 2013 at 18:32 UTC

    Yo dawg, I heard you like evals.

Re^2: die through several evals
by nyaapa (Novice) on Apr 24, 2013 at 09:02 UTC
    i have sub $s and i execute something like
    eval { $s->(); };
    on alarm i die and if there any non-propagating evals in $s i'll stuck =(
      ... i'll stuck

      Stuck where? Doing what?

      I don't see anything getting "stuck"?:

      sub mys{ print "??$_[0]??"; eval{ die 'bad stuff' if $_[0] eq 'die' }; };; print 'here'; eval{ mys( 'hello' ) }; print 'there'; eval{ mys( 'die' ) }; print 'over here';; here ??hello?? there ??die?? over here

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        $SIG{ALRM} = sub { die "TIMEDOUT" }; my $sub = sub { warn "visible"; eval { # some big action in eval sleep(); }; warn "invisible"; }; # execute $sub with timeout alarm(1); $sub->();
        and get
        visible at -e line 1. invisible at -e line 1.