my (%count); #### undef $/; while(<>){ my @chars=split(//,$_); foreach my $char (@chars) { $count{'vow'}++ if(/[aeiou]/); $count{'sen'}++ if(/\./); }