in reply to Reading in Block
As a quick and nasty script something like this perhaps?
use strict; use warnings; my %names; my $name; local $/ = '--------------------------------------------'; while (<DATA>) { chomp; s/\s+/ /g; next if ! /\S/; if (! defined $name) { $name = $_; next; } my @words = split; $names{$name} += @words; $name = undef; } print "$_: $names{$_}\n" for sort keys %names; __DATA__ -------------------------------------------- Joe Moglia, Ameritrade - CEO 3 -------------------------------------------- Thank you, Donna. Good morning, everybody and welcome to our last conf +erence call for Ameritrade as a stand-alone entity and for our very, very fir +st conference call for TD Ameritrade. -------------------------------------------- Randy MacDonald, Ameritrade - CFO 13 -------------------------------------------- There's one other element that makes it easier which is that Waterhous +e outsources their clearing to ADP and we've had -- this is our eighth i +ntegration and we've gone through that with ADP a number of times now. So we have + a pretty well worn cookbook on how to do that. ------------------------------------------------------------
Prints:
Joe Moglia, Ameritrade - CEO 3 : 30 Randy MacDonald, Ameritrade - CFO 13 : 51
You might want to tidy that up a little before you show it to your boss or teacher though! Altogether too much use of the default variable.
|
|---|