in reply to Array manipulation
#!/usr/bin/perl while(<>) { chomp; print $_ . substr($_,0,2) . "\n"; }
Accepts files either from standard input, or named on the command line, iterates over each line, prints with the first two characters (of each line) repeated at the end of the line.
|
|---|