in reply to Re^2: Count occurrences and rename words in order
in thread Count occurrences and rename words in order

Yeah, that works. It's unclear what the original poster wanted to do for multiple lines. I assumed that the counts should be cleared. In which case you'd do something like this:

$ perl -pe '%counts=();s|(/\w+)|$1 . ++$counts{$1}|ge' logfile>counted +logfile
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg