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

New line & print problem

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I started with the first script which returned the
form albeit in one long line.

print messtxt ($lastname);
print messtxt ($firstname);

The next, which I am told should return the form with each
result on a new line. However it returns a blank form.

print "messtxt: $lastname\n";
print "messtxt: $firstname\n";

Can anyone help

Wayne C
 
a little more context would help.... ...a wild guess follows.....
Is this going to a browser?, HTML?? If so, the browser will ignore the new line chars (\n) unless they are in a <pre> tag. So, try using <br> instead of or with your new line chars.




HTH


keep the rudder amid ship and beware the odd typo
 
You put the quotes in the wrong place. The first two lines print data to a file handle called messtxt. The second two lines print a string to stdout. What you needed to do was:
Code:
print messtxt &quot;$lastname\n&quot;;
print messtxt &quot;$firstname\n&quot;;

Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top