in reply to Hash not working as intended

You have to show us what $pbxex looks like. If the hash already has something in it, your code seems to work fine for me:
use warnings; use strict; my %hash = (CS => 4); while (<DATA>) { chomp; $hash{$_}++; print "$_$hash{$_}\n"; } __DATA__ CS CS
prints:
CS5 CS6