Hi Ben:
On Mon, Jan 26, 2004 at 04:47:17PM -0500, Ben Ostrowsky wrote:
> HTML > BODY > TABLE[3] > TR[7] > TD[1]
HTML::Parser is quite complex, and like Chuck said you need to get your
head around callbacks to start working with it. Callbacks are a really handy
technique to use, and as Chuck also
> my $html = get("http://weather.noaa.gov/weather/current/KVDF.html";)
> or die"0\n0\n";
If you're relying on a calling program seeing that 0\n0\n as if they're
the temp and humidity, you'll have a problem. The output from die()
goes to STDERR, but you're printing successful results to STDOUT.
Thanks to everyone who helped me! Here's how I finally did it:
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my $html = get("http://weather.noaa.gov/weather/current/KVDF.html";)
or die"0\n0\n";
$html =~ m/Temperature.* (.*) F \((.*) C\).* Dew Point/s or die "0\n0\n";
# yeah, it's a bit of a k