> 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.

> $html =~ m/Temperature.* (.*) F \((.*) C\).* Dew Point/s or die "0\n0\n";

Better still, instead of .*, use .+ because you know you want at least
one:

  $html =~ m/Temperature.* (.+) F \((.+) C\).* Dew Point/s or die "0\n0\n";

Even better, since you know they need to be digits:

  $html =~ /Temperature.* (\d+) F \((\d+) C\).* Dew Point/s or die "0\n0\n";

And you can leave off the m at the beginning.


-- 
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance

Reply via email to