On Tue, Sep 6, 2016 at 9:11 AM, Matt <matt.mailinglists@gmail.com> wrote: > I am receiving log entries as a string and then writing them to a file > with the date tacked on beginning. Problem is that sometimes the > string I receive contains \n and it makes parsing the file with grep > more difficult. Looking for a simple way to replace all \n in the > string with text <CR> or something of that sort. > > It might be even better yet to replace all characters that are not > directly printable with there HEX equivalent since I only need > readable text log info on one line. Is there an easy way to do that? Perhaps you might want to look at "chomp"? http://perldoc.perl.org/functions/chomp.htmlThread Previous