if ( /\s*Out Comments\s*(.*)$/ ) { push @out_comments, $1; while (<>) { # quit on a blank line or ------- last if /^\s*$/ or /^\s*[-]+\s*$/; s/^\s*//; # get rid of spaces at the beginning push @out_comments, $_; } next; } # if /Out Comments/