@array = ("12G","1G30G","13G24G"); map { $cntr++ if /G/ } @array; print "$cntr\n";