texuser74 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
My present script
#!/usr/bin/perl use strict; use warnings; my $mycnt; while(<DATA>){ s!Number this.!++$mycnt.') Number this.'!ie; print; } __DATA__ Sample text. Number this. Number this. Sample text. Number this.
Outputs:
Sample text. 1) Number this. 2) Number this. Sample text. 3) Number this.
Is there any option in perl to change the counter to print alphabets, e.g. required output is
Sample text. a) Number this. b) Number this. Sample text. c) Number this. ...
Thanks in advance

Replies are listed 'Best First'.
Re: alpha counter
by ikegami (Patriarch) on Mar 25, 2010 at 05:42 UTC
    my $mycnt = 'a'; and switch to post increment.
      wow, so easy, Thank you very much.