<% my $source = $Server->MapPath("debate040930.txt"); my @debates = (); open IN, "<$source"; while () { chomp; push( @debates, $_ ) } my $phrase = $Request->QueryString("p"); my $speaker = $Request->QueryString("s"); my $filter = $Request->QueryString("f"); my @debates_mark = (); while (@debates) { my $turn = pop(@debates); my ($speak, $text) = $turn =~ /^([A-Z]+): (.*)$/; $text =~ s!($phrase)!$1!ig if $phrase; $turn = "$speak: $text"; my $use = 1; if ($speaker =~ /(kerry|lehrer|bush)/) { $use = 0 unless $speak =~ /$speaker/i; } if ($filter) { $use = 0 unless ($text =~ /\W$phrase\W/i); } push(@debates_mark, $turn) if $use; } %> Debate Spotter
highlight phrase:   speaker:   matching statements only: >  
<% foreach my $turn (@debates_mark) { %>

<%= $turn %>

<% } %>