in reply to Array manipulation
Another way is to use the four argument form of substr rather than concatenation.
$ perl -Mstrict -Mwarnings -E ' open my $inFH, q{<}, \ <<EOD or die $!; 1234 5678 1000 1233 123456 EOD say for map { chomp; substr $_, length, 0, substr $_, 0, 2; $_; } <$inFH>;' 123412 567856 100010 123312 12345612 $
I hope this is helpful.
Cheers,
JohnGG
|
|---|