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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newline not Working

Status
Not open for further replies.

vtsao

IS-IT--Management
Jul 29, 2003
6
US
I having problem with the newline. For example, whatever I input it just comes out as one line. I have tried "\n", but I just does not seem to be working. I know is something very simple. I just can't figure out? Suggestions, comments are all welcome.

Thank you,
Victor


#!/usr/bin/perl -wT

use strict;

use CGI ':standard';



my $last;

my $first;

my $email;

my $address1;

my $address2;

my $comments;


$last = param("last");

$first = param("first");

$email = param("email");

$address1 = param("address1");

$address2 = param("address2");

$comments = param("comments");


open (FILE, ">> list.txt");

print FILE "$last, $first, $email, $address1, $address2, $comments\n";

close (FILE);



print "Content-type: text/html\n\n";

print "Thank you for submitting your information.\r";

print "The following is what you have entered your\r";

print "Last Name: $last\n First Name: $first\n Email: $email\n Address: $address1\n $address2: \n Comments: $comments \n";


 
Code:
\r\n [b]or[/b] \n\r

I assume your're on Windows, can remeber which but its one of those combos above, but seeings as you're outputting html you most probably need to use <br> tags in place of newline characters

Code:
print "Last Name: $last<br>\n First Name: $first<br>\n Email: $email<br>\n Address: $address1<br>\n $address2:<br> \n Comments: $comments <br>\n";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top