in reply to Concatenate and join
Update: Fixed typo in code above, to produce right answer.perl -e '@x=qw| 28 8a 1c 59 cc 85|; my $o=""; for (my $i=0; $i<$#x; $i+=2){ $o.=$x[$i].$x[$i+1]."."} chop $o; print "$o\n"' 288a.1c59.cc85
There are other, slightly more elegant methods (using natatime from List::MoreUtils), but to use those, you will need to use CPAN modules.
Here is another option (Has trailing "."):
Note -: This one destroys the source array.perl -e '@x=qw| 28 8a 1c 59 cc 85|; while ($_=shift @x){ print "$_" .shift (@x) . "."}'
This is not an optical illusion, it just looks like one.
|
|---|