in reply to function or something
To capture the value returned, you can do this:sub example { my $number = shift; eval { if (2 / $number > 3) { return 1; } }; print "Still here\n"; }
my $value = eval { # Do stuff; return 4; };
Alternately:
my $value; eval { # Do stuff; $value = 4; };
|
|---|