I want to add letters A,B,C,� in front of every line of input while printing them out using PERL.
eg
A file is parsed as a cmd line arg and its context will be displayed as
A line1...
B line 2..
I tried this..but I want better and perfect solution!
!perl -p
my $counter;
BEGIN { $counter = q{A}; }
print $counter++;
Source(s):
The -p will make it print every input line automatically.
First question: if it works, why do you want to change it?
Second question: when you hit line numbers > 26, how should it progress? As AA, AB, AC, ... or just stop?
@ungalnanban: Your solution only works if you know the number of lines beforehand.