in reply to bignum, can't return outside a subroutine

What makes you think it's a problem returning a big num from the subroutine? There's no evidence of that. Problem: use bignum; isn't in effect in the eval. Fix:

sub operation { my ($arg) = @_; my $product = eval "use bignum; $arg"; return abs $big_number - $product; }

Or use the existing bignum instead of making a new one.

sub operation { my ($arg) = @_; my $product = eval "\$arg"; return abs $big_number - $product; }

Replies are listed 'Best First'.
Re^2: bignum, can't return outside a subroutine
by zli034 (Monk) on Oct 09, 2007 at 23:07 UTC
    Thank you mate