CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Newline command

 



S_Shrum
User

Feb 22, 2001, 8:44 PM

Post #1 of 3 (272 views)
Newline command Can't Post

I am trying to get a newline (carriage return into my file).

However, when I do:

print $DB "$_\n";

I get a block on the end (as seen in Win Wordpad).

I would like the line that the cursor is on in the data file to be on the next blank line.

What do I need to do in order to get the proper carriage return?

Sean Shrum
sean@shrum.net
www.shrum.net


kencl
User

Feb 22, 2001, 9:55 PM

Post #2 of 3 (270 views)
Re: Newline command [In reply to] Can't Post

I was just reading about this in O'Reilly's CGI Programming 2nd ed. \n is line feed and \r is carriage return. Windows uses both to indicate a new line, so what you need is \r\n.

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!


muinatit
Deleted

Feb 23, 2001, 2:25 PM

Post #3 of 3 (260 views)
Re: Newline command [In reply to] Can't Post

From what I've heard \n will make a newline for Unix, and \r will make a newline for Windows. But if you read it in a bood, it's gotta be better than my ideas. :)

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives