LINE: while (my $line = <$INFILE> ) { chomp next LINE if $line =~ m<\A\s*{>; # # or if it was going to be literally # the first char, with no spaces ... # next LINE if q<{> eq substr $line, 0, 1; # # other processing # $text .= $line . $NEWLINE; } #### next LINE if length $line == 1 and q{\} eq substr $line, 0, 1; #### s/(?<=\n)\s+//; #or, line by line: s/\A\s+// #### s/\s+\n//; #### Readonly my $ESC_BACKSLASH => q{\\}; Readonly my $NEWLINE => q{\n}; $wholefile =~ s/$ESC_BACKSLASH\z//o; #### Readonly my $RTF_CMD => qr/$ESC_BACKSLASH [\w-]+/xo; s/$RTF_CMD//;