That removes all empty lines, not just those that were comments. Fix:
while (<INFILE>) { chomp; next if /^\s*#/; s/\s*#.*$//; print OUTFILE "$_\n"; }
In reply to Re^2: Regex in a printfile?
by ikegami
in thread Regex in a printfile?
by Andrew_Levenson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |