Could also be coded...this does the same thing:
...
my @clk_new = map{my $line =join ("_", @$_); $line}@clk_output;

But isn't it also true that the statement
    my @clk_new = map{my $line =join ("_", @$_)}@clk_output;
would do the same thing? In which case, there seems to be no point to assigning to a lexical within the map block, so we're back to
    my @clk_new = map{ join('_', @$_) }@clk_output;
or
    my @clk_new = map join('_', @$_), @clk_output;

Prior to the introduction of the  /r modifier for  s/// substitution in Perl version 5.14 (see Regexp Quote Like Operators in perlop), there was sometimes a need for a map statement like
    map { (my $r = $_) =~ s{ ... }{foo}xms;  $r; }
to avoid changing the aliased referent of  $_ in a data flow, but it doesn't seem useful here. (I can't tell you how many times I've had to remember to do this when a bunch of unexpected '1' characters suddenly showed up in my output!)

A similar situation might arise if one wanted to stick a debug print-point
    map { print "... $_ ...";  $_; }
into the middle of a data flow.


Give a man a fish:  <%-{-{-{-<


In reply to Re^2: join string in 2D array by AnomalousMonk
in thread join string in 2D array by Newbie95

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.