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!

\n isn't functioning correctly

Status
Not open for further replies.

chitownclone

Programmer
Mar 30, 2004
22
0
0
US
I am writing data to a file using the following:

open (DATA, ">>../cgi-bin/data/marketinfo.dat");
print DATA "$variable1\~$variable2 \n";
close (DATA);

It worked just fine on my server, but when I uploaded it to my client's server the \n doesn't work.

Rather than starting a new line for each new line of data the \n is writing as a square which separates each line. So rather than a formated data file I have a file with 1 line with data lines separted by a square.

Anyone have any idea why \n isn't working??

 
Are you moving it to a PC from *NIX ?

... i'm not sure but try \r\n


Kind Regards
Duncan
 
Sounds like a unix to dos translation problem.If you do a \r\n and that still leaves a block there, then just use the \r.

___________________________________
[morse]--... ...--[/morse], Eric.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top