use strict; use warnings; my %hash; do { chomp; $_ = qq|$_.$hash{$1}| if /(ID=.+)$/ and ++$hash{$1}; print "$_\n" } for ;