http://qs321.pair.com?node_id=264581


in reply to Appending strings from one array onto strings of another

And here are my 2 Euro-Cent
@z=map{$_.$d[-1+push@d,shift@d]}@z;
Update: One can use a side-effect and avoid the assignment of an array:
map{$_.=$d[-1+push@d,shift@d]}@z;

Replies are listed 'Best First'.
Re: Re: Appending one array onto another
by sauoq (Abbot) on Jun 10, 2003 at 09:33 UTC

    And using aliasing to our advantage but avoiding map in void context yields

    $_ .= $d[-1 + push @d, shift @d] for @z;
    I'm not convinced that it's at all better than the first one in the OP though. This is a bit obscure for no really good reason.

    -sauoq
    "My two cents aren't worth a dime.";
    
      I like that one!

      It's obscure, yes. But not for "no really good reason" but for avoiding an aditional variable. But now as I think of it ;-) Okay: It's no really good reasone. Maybe I should think about my taking part in perl-minigolf and obfuscation.