in reply to adding non printable characters in perl's print function

To answer the implicit half of your question, to get the effect of \n you need both a carriage return (to go to the start of the line) and a line feed (to go to the next line). This combination is frequently referred to as a "CRLF".
#!/usr/bin/perl use strict; print ":Hello \x0D\x0A world:\n";
This outputs
:Hello world:
Note that this is all a bit system-dependent, as \n represents only a LF on Unix-type systems (which add an implicit CR), only a CR on (pre-OS X) Macs (which add an implicit LF), and CRLF on Windows. So it's probably best to just use \n instead of mucking about with the literal control characters anyhow.