My preferred style of using eval is
my $content; my $ok = eval { $content = $self->web_fetch( ... ); 1 }; if( ! $ok ) { my $err = $@; ... };
This avoids needing to think about whether there was an error or the assignment returned a false value. I think that Try::Tiny provides some syntactic sugar for this approach.
In reply to Re: What does eval actually do?
by Corion
in thread What does eval actually do?
by kiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |