in reply to Replace specific lines specific range of characters.
I understand most of that, but it might help to have sample input / output so we can be sure we're programming the right code. And why exactly is your script a series of executed one-liners? Why not just do it like a regular Perl script? First time I've ever seen something done this way.