by yitzle@[EMAIL PROTECTED]
(Yitzle)
May 6, 2008 at 10:37 AM
I'm sure someone more experienced will have a far more elegant
solution, but something along these lines might work.
(Note: code untested)
%count;
while (<>) {
if ($_ =~ /^"([^"]*)"/) {
%count{$1}++;
}
}
for (keys %count) {
print "$_ - $count{$_}\n";
}
or, refractored,
%count;
while (<>) {
%count{$1}++ if (/^"([^"]*)"/);
}
print "$_ - $count{$_}\n" for (keys %count);