#!/usr/bin/perl
use strict;
use LWP::Simple;
# declare our variables for safety
my ($sawFCEnd, $sawBR, $link, $title);
# suck down the webpage
my $content = get("http://dailynews.yahoo.com/htx/ts/");
# split the content on each new line, and loop through the lines
foreach(split(/\n/, $content)) {
# if we see FCEnd, we're getting close
if (//) { $sawFCEnd=1; next; };
# if we see two
's on a line, we're even closer
if ($sawFCEnd && /
/) { $sawBR=1; next; };
# if we saw the two
's, this must me our news
# link, OR if the line starts with (.*)<\/b><\/a>/);
# print a line only there's a $link
print "$title\n" if defined($link);
}
# start over again
next;
}