Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix/Perl ASCII Carriage return 1

Status
Not open for further replies.

jasc2k

Programmer
Nov 2, 2005
113
GB
Hi all,

I am having a small issue when sending data over a TCP socket. Basically I need to send a carraige return as an ASCII code at the end of our data (to signify the end of data stream).

The ASCII code is Alt+13 but when typing this into our perl script it actually performs a carriage return as opposed to converting it ready to send. I have tryed other ASCII chars and they are fine but when they are typed into the perl script they are converted correctly on screen to their ASCII code in unix

In our unix test file (as attached) when viewed in unix appears as ^M but this does not appear to work if I try to send that - it is sent as text. We have tryed excaping it first with a backslash with still no luck?

Any ideas greatly appreciated,
Thanks

- free mp3 downloads and streaming
 
Hi Miller,

Thanks for your answer - I should have probably thought of that but it did lead me to the final answer being:
chr(13).chr(10)

Many many thanks,
James

- free mp3 downloads and streaming
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top