in reply to Re^2: Recursion problem
in thread Recursion problem

... and if $target < 0 no list fulfills the condition, so return 0 if $target < 0; is the second hint

Update: no, sorry, I wrongly assumed that the array containn only positive integers...

So the second hint should be return 0 if @array==0

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.