help with a perl script

Discussion in 'OT Technology' started by jayrod, Jun 27, 2004.

  1. jayrod

    jayrod Lurker extraordinaire...

    Joined:
    Jul 19, 2001
    Messages:
    2,663
    Likes Received:
    0
    I'm not really good at programming at all, so I need help with something I'm sure will be relatively simple to do.

    the script takes an RSS feed and converts it to html. Currently, it iterates through all the items contained in the feed and prints them out in an html file.

    I need to alter this block of code in the script:
    Code:
        # print the channel items
        foreach my $item (@{$rss->{'items'}}) {
    	next unless defined($item->{'title'}) && defined($item->{'link'});
    	print "<li><a href=\"$item->{'link'}\" target=\"_blank\">$item->{'title'}</a></li><br />\n";
        }
    so that, instead of printing all the items, I can control how many it outputs with a counted loop.

    the full source can be found here:

    http://www.webreference.com/perl/tutorial/8/source.html

    and notes about how the script works can be found here:

    http://www.webreference.com/perl/tutorial/8/index.html

    note: the source on the web differs slightly from my pasted code, however, I've only modified the display portion of the script (how the output looks).
     
  2. jayrod

    jayrod Lurker extraordinaire...

    Joined:
    Jul 19, 2001
    Messages:
    2,663
    Likes Received:
    0
    thanks

    i'll give that a try
     

Share This Page