How can I get Perl to spit out control characters, such as ^J (the
linefeed) as the actual control character? Every time I try to print
it, Perl converts it to the ASCII \n character.

I need to process a  file, converting a \n to \cJ, AKA the ^J
character. I've tried various things with sprintf, hex(), and other
random things, but no luck.

Has anyone else had to deal with this before?

If I pipe the output of the file to "od -c" on the command line, the
other control characters (which are already correct in the file) seem
to come through as their octal value. However, most attempts to
convert the  \n into a ^J seem to end up with Perl interpreting it to
\n or a null character, [EMAIL PROTECTED] I think that if it's working 
correctly, I
should start seeing the ^J (\n) as the octal character "21."

Thanks for the help.

Shawn

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to