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; }