in reply to Re^3: Merge 2 strings like a zip [unzip()]
in thread Merge 2 strings like a zip
You're welcome.
Regarding the for statement modifier, I think ++hexcoder has covered most of this in his response.
That's a fairly common Perl idiom that you're likely to see a lot. In fact, my usage wasn't the first in this thread: BrowserUk's zip() code has '... for split '', $b;'.
There's a bit more going on behind the scenes.
print for unzip('AaBbCcDdEeFGHIJ', 5);
is equivalent to
for (unzip('AaBbCcDdEeFGHIJ', 5)) { print STDOUT "$_\n"; }
-- Ken
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Merge 2 strings like a zip [unzip()]
by tel2 (Pilgrim) on Jul 10, 2015 at 00:39 UTC | |
by kcott (Archbishop) on Jul 10, 2015 at 04:35 UTC | |
by tel2 (Pilgrim) on Jul 12, 2015 at 22:52 UTC |