On Tue, Sep 6, 2016 at 9:11 AM, Matt <matt.mailingli...@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.html

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to