in reply to Getting headlines from NewsML

Try printing out the arrays and objects to narrow down where it is failing.
print "$newslines\n"; my @headlines = $newslines->getHeadLineList(); print "@headlines\n"; foreach my $h (@headlines) { print "$h\n"; print $h->getHeadLine(),"\n"; }

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Getting headlines from NewsML
by cormanaz (Deacon) on Aug 27, 2005 at 17:45 UTC
    Doing this identified the object in @headlines as Syndication::NewsML::HeadLine=HASH(0x25055e8). In other words it was already a headline, so of course $h->getHeadLine wouldn't work. I needed to $h->getText and everything worked fine. So the working code segment is:
    if (my $newslines = $newscomp->getNewsLines) { my @headlines = $newslines->getHeadLineList(); foreach my $h (@headlines) { print "$h\n"; print $h->getText(),"\n"; } }