in reply to Re: Surprised by join
in thread Surprised by join

Your approach was exactly what the OP was looking for (++), but your example has some excess baggage that made it confusing for me. Simplified:
sub myjoin (&@) { my $sub = shift; my $res = shift; $res .= $sub->() . $_ for (@_); $res; }
Update: Oh, I see: the arguments to sub were to stand in for $a and $b (a la sort), in case the user wanted to have that kind of flexibility in the sub.

Is the thread title a C.S. Lewis reference, I wonder?


The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re^3: Surprised by join
by EdwardG (Vicar) on Jun 08, 2004 at 19:10 UTC
    Is the thread title a C.S. Lewis reference, I wonder?

    It is, well spotted.