in reply to A Reg Exp Question
You could, of course, append $_ to a variable called $line if you wished. Feel free to add more small regexes, or modify the existing ones. Sometimes a line-by-line transformation is easier.# open file, don't do the local $/ trick while (<FILE>) { next if /^\s*print/; next if /^\s*#/; push @lines, $_; }
|
|---|