BEGIN { $^I = ".orig"; } while (defined($_ = )) { if ($c) { s/^line(\d+)/name$1/; } $c = /^\$\$\$\$$/; print $_; }