open FILE, "path/to/file"; local $/ = "\n\n"; my $first_part = ; #### open FILE, "path/to/file"; local $/ = undef; my $whole_file = ; my $first_blank_pos = index($whole_file,"\n\n") die "no blank lines" unless ($first_blank >= 0) my $first_part = substr $whole_file, 0, $first_blank_pos; my $second_part = reverse substr $whole_file, $first_blank_pos;