in reply to Concatenating more than one variable in perl
most likely a XY Problem, people who number their vars hate arrays.
Though for fun...
DB<110> use List::MoreUtils "pairwise" DB<111> ($x,$y)=("X","Y") => ("X", "Y") DB<112> pairwise { $$a .= $b } @{[\($x,$y)]}, @{["x","y"]} => ("Xx", "Yy") DB<113> $x,$y => ("Xx", "Yy")
Not sure if versions newer than 5.10 allow to get rid of the '@{...}'.
Cheers Rolf
(addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Concatenating more than one variable in perl
by AnomalousMonk (Archbishop) on Jun 19, 2014 at 16:15 UTC | |
by LanX (Saint) on Jun 19, 2014 at 22:41 UTC |