Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Replace strings in text file

by pwagyi (Monk)
on Sep 24, 2018 at 03:22 UTC ( [id://1222902] : note . print w/replies, xml ) Need Help??

in reply to Replace strings in text file

What are you trying to accomplish here? Have you read man page of sed ?

The sed utility is a stream editor that reads one or more text files, makes editing changes according to a script of editing commands, and writes the results to standard output.

Since you are already using perl, why not just use perl to perform substitution (a lot of monks had already given out code) instead of *nix sed, then your code will be portable (across other OSes, like windows).