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

Writing to a text file

Status
Not open for further replies.

andyros

Programmer
Jul 12, 2005
42
GB
Hey guys

Just a quick question, I'm writing, to a html file, a link whose href and text comes from another file.

The problem im having is when i add together the final string ready to write out:

<code>$replaceString = "<a href=$url[$j]>$description[$j]<\/a>";</code>

the problem is that once the url bit is wrote to the file it moves to a new line and prints the rest.

eg.

<a href = >gooooogle</a>

but it should look like

<a href =
It displays fine in the browser it just poses a problem for a further addition to the script.

any ideas?

cheers
andy
 
ignore the <code> bits, i should have used [code=but got confused!
 
apologies guys, ive sorted the problem

i forgot the chomp the inputs :\!
 
See if this helps:

Code:
$replaceString =~ s{\n}{};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top