in reply to Re: Should we handle multiple arguments as a list?
in thread Should we handle multiple arguments as a list?

Even more fun (but less efficient) than this would be to just make the function recursive.

sub add_two { my @in_values = @_; if( wantarray ) { #must use +0 to force scalar #otherwise we get deep recursion return map add_two( $_ ) + 0, @in_values; } else { return $in_value[0] + 2; } }
  • Comment on (ichimunki) Re x 2: Should we handle multiple arguments as a list?
  • Download Code