From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Greg 
Aiken
Sent: 26 November 2012 16:19
To: Perl-Win32-Users@listserv.activestate.com
Subject: 'mysplit' ???

> 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?

I may have misunderstood your question, but mysplit is the sub defined above 
(see ^^^^^^^).

HTH


--
Brian Raven




________________________________

Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to