my %tot_count; ++$tot_count{ (/(\S+)/)[0] } for @full_names; my %cur_count; s/(\S+)/ $1 . ( $tot_count{$1} > 1 ? ++$cur_count{$1} : '' ) /e for @full_names;
Update: Fixed bug.
In reply to Re: Indexing multiplicate firstnames with regex
by ikegami
in thread Indexing multiplicate firstnames with regex
by stringZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |