Gossamer Forum
Home : General : Perl Programming :

Help joining elements

Quote Reply
Help joining elements
I'm a newcomer/novice to perl, but am trying to modify a script to retrieve headlines from another page. The script works with one "minor" flaw....each headline wraps to two lines.

We have:
Code:
@lau=split(/\n/,$doc);
In the source code of the site I'm pulling headlines from, each headline is formatted as follows:
Code:
One
word on line one and the others on line two.
So, of course, my results return in the same manner, with only the first word linked to the reference source. What do I need to do to join lines one and two of each headline? Each new headline is prefaced by a <LI> tag, and ends with an </A> tag.

Thanks!



Melanie
http://www.somemoorecats.com/
http://www.okhima.org/
Quote Reply
Re: Help joining elements In reply to
Can you post an exact piece of code you're trying to work with? (a real, complete, line one and two)

-mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: Help joining elements In reply to
Sure....

The code on the page I'm pulling from is:

Code:
<LI><a href="/source.htm"><font face="Arial, Helvetica, sans-serif" size="2">Few
diabetics stick to exercise, diet plans</font></a>
<LI><font face="Arial, Helvetica, sans-serif" size="2"><a href="/source2.htm">US
investigates asbestos content in crayons</a> </font>
Melanie
http://www.somemoorecats.com/
http://www.okhima.org/
Quote Reply
Re: Help joining elements In reply to
Just got it to work....but thanks!

Melanie
http://www.somemoorecats.com/
http://www.okhima.org/