in reply to SOLVED Please Help
You may like:
use strict; use warnings; my $data = <<DATA; Some sample text with the odd ',', '.', '[', ']' and '-' as test input. DATA open my $inFile, '<', \$data; my %hits; while (<$inFile>) { ++$hits{$_} for split ''; } print "$_: $hits{$_}\n" for ',', '.', '[', ']', '-';
Prints:
,: 4 .: 2 [: 1 ]: 1 -: 1
|
|---|