in reply to Hash not working as intended
use warnings; use strict; my %hash = (CS => 4); while (<DATA>) { chomp; $hash{$_}++; print "$_$hash{$_}\n"; } __DATA__ CS CS [download]
CS5 CS6 [download]