first: this:that here:there when:what how:where now:later second: this:that here:there when:what how:where now:later #### use strict; use warnings; use Data::Dumper; my $file = "new_testfile.txt"; my $testhashref; open (my $fh, "<",$file) or die "Can't open open file $file:$!"; { local $/ = ""; while (my @records = <$fh>) { foreach my $line (@records) { next if $line =~ /^[a-z]+:$/m; print "$line"; } } } #### pritesh@pavilion:~/perlscripts$ perl test.pl pritesh@pavilion:~/perlscripts$ #### pritesh@pavilion:~/perlscripts$ perl test.pl first: this:that here:there when:what how:where now:later second: this:that here:there when:what how:where now:later