i just ran across a perl recursion example that i am trying to understand...

(url =
http://www.shlomifish.org/lecture/Perl/Newbies/lecture2/functions/recursion.html
)

sub mysplit
{
    my ($total, $num_elems, @accum) = @_;

    if ($num_elems == 1)
    {
        push @accum, $total;
        print join(",", @accum), "\n";

        return;
    }

    for (my $item=0 ; $item <= $total ; $item++)
    {
        my @new_accum = (@accum, $item);
        mysplit($total-$item, $num_elems-1, @new_accum);   #<<<<<<<<<<<<
'mysplit'
    }
}
mysplit(10,3);

the line of code ive never seen before, and am struggling with to
understand - is the following...

   mysplit($total-$item, $num_elems-1, @new_accum);

ive 'googled' the word 'mysplit' and find no results.

might anyone know exactly what 'mysplit' is?
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to