Gossamer Forum
Home : General : Perl Programming :

general problem

Quote Reply
general problem
Hello,

I;m havig some broblem with a script i wrote to get newsheadlines from another site.
-they allowed me:-)

But the script has to open 2 differen text files and make into one @headlines.

But this wont work:
@headlines = @listone + @listtwo;


Another problem is, that i then have to go though @headlines, like below: But i want to let the script number each output. go I get a total output like this:

1 - headline one
2 - headline two


foreach my $elem (@headlines) {
my($url,$headline) = $elem =~ m|<A HREF="(.*?)"(?:.*?)>\s*(.*?)\s*</a>|sgi;

$output .= "<br> - <a href=\"$url\">$headline</a>\n";

}

if ($output eq '')
{
$output = "<br>[ no news available ]\n";


Please help me......
Subject Author Views Date
Thread general problem cK 3532 Jan 7, 1999, 4:46 AM
Post Re: general problem
CEGlobe 3395 Jan 7, 1999, 4:56 AM
Post Re: general problem
fhirsch 3394 Jan 7, 1999, 6:32 AM
Post Re: general problem
cK 3430 Jan 7, 1999, 7:20 AM