in reply to function or something

One thing to keep in mind if you use eval {} is that a return inside the eval block returns from that block - not from the outer function.
sub example { my $number = shift; eval { if (2 / $number > 3) { return 1; } }; print "Still here\n"; }
To capture the value returned, you can do this:
my $value = eval { # Do stuff; return 4; };

Alternately:

my $value; eval { # Do stuff; $value = 4; };