sub sumTo { return 0 if $_[0] == 0 && @_ > 1; _sumTo(@_); # or &_sumTo if you want to be cryptic } sub _sumTo { my ($target, @list) = @_; return 1 if $target == 0; return 0 if @list == 0; # here goes the recursive call to _sumTo }