Ok, solved it :)
> if ( @_ >= $num )
> {
> my $sum = 0;
> $sum += $_ for @myList[@_];
>
> ... # do some calculations here
>
> return 1;
> }
>
> for my $i ( ( @_ ? $_[-1] + 1 : 0 ) .. ( @myList - $num + @_ ) )
> {
> iterate( @_, $i );
> }
I moved the part above to a second subroutine, which solved the problem.
Now I only need to find out how to output the results to an NSTextView.
- Koen.
