in reply to capturing blocks of data

I hope I read the question right. This is untested, but I think it does the right thing:

use File::Slurp; my $big_text = read_file ('bigFile.txt'); my @blocks = split/HOSTNAME/, $big_text; foreach my $block(@blocks) { print "$block\n"; }
Hope that helps...