in reply to sed in perl script

Perl works better when you use it as Perl and not as a shell script tying together sed and awk.

Maybe you can show us what code you've already written.

Note that many sed commands exist in Perl as well, most notably s///.

Note that many awk commands exist in Perl as well, most notably, print.