in reply to Reading in Block

You could just read the file into a var and use a regex match.

A custom line terminator would also do the trick.

local $/ = "\n--------------------------------------------\n" <>; for (;;) { my $speaker = <>; last if !defined($speaker); chomp($speaker); my $speech = <>; chomp($speech); ... }