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

Writing into a file

Status
Not open for further replies.

thendal

Programmer
Aug 23, 2000
284
Hi all!

We can print out a html file as follows(dumping all the html codes in between tags.

print << &quot;
HTML:
&quot;;

<html>
</html>

[HTML]

ll'ly is there any way dump the html to a file

like

print FILE << &quot;[end]&quot;;

<html>
</html>

[end]

close(FILE);

because in this way i can don't need to specfically escape the double quotes character.

I hope i have conveyed my question.

Thendal:)
 
I just did it with this test script:

#!/usr/bin/perl -w
#
open(TEST,&quot;>test.txt&quot;) || die &quot;Couldn't open file test.txt!\n&quot;;
print TEST <<END;

This is just a test.
Line 2.

END
-----------------------------------

This creates file test.txt which contains this:

This is just a test.
Line 2.

------------------------------------

Why are you using double quotes? Your here-document tags don't need double quotes.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
ThanX I am little bit X-)

Thendal:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top