in reply to Surprised by join
I'm pretty sure that the only things that evaluate an argument more than once will accept a BLOCK type argument. For example, sort BLOCK LIST or map BLOCK LIST. Curly braces. A bit of code to be evaluated on each iteration.
my $result = ''; my @list = qw(one two three four five six seven eight); $result .= (shift @list).':'.(shift @list) while @list; print $result, $/; __OUTPUT__ one:twothree:fourfive:sixseven:eight
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Surprised by join
by EdwardG (Vicar) on Jun 08, 2004 at 13:27 UTC |