Note that there are some explanatory texts on larger screens.

plurals
  1. POA little help with perl HTML parsing
    text
    copied!<p>I am working on a small perl program that will open a site and search for the words Hail Reports and give me back the information. I am very new to perl so some of this might be simple to fix. First my code says I am using an unitialized value. Here is what I have</p> <pre><code>#!/usr/bin/perl -w use LWP::Simple; my $html = get("http://www.spc.noaa.gov/climo/reports/last3hours.html") or die "Could not fetch NWS page."; $html =~ m{Hail Reports} || die; my $hail = $1; print "$hail\n"; </code></pre> <p>Secondly, I thought regular expressions would be the easiest way to do what I want, but I am not sure if I can do it with them. I want my program to search for the words Hail Reports and send me back the information between Hails Reports and the words Wind Reports. Is this possible with regular Expressions or should I be using a different method? Here is a snippet of the webpages source code that I want it to send back</p> <pre><code> &lt;tr&gt;&lt;th colspan="8"&gt;Hail Reports (&lt;a href="last3hours_hail.csv"&gt;CSV&lt;/a&gt;)&amp;nbsp;(&lt;a href="last3hours_raw_hail.csv"&gt;Raw Hail CSV&lt;/a&gt;)(&lt;a href="/faq/#6.10"&gt;?&lt;/a&gt;)&lt;/th&gt;&lt;/tr&gt; #The Data here will change throughout the day so normally there will be more info. &lt;tr&gt;&lt;td colspan="8" class="highlight" align="center"&gt;No reports received&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th colspan="8"&gt;Wind Reports (&lt;a href="last3hours_wind.csv"&gt;CSV&lt;/a&gt;)&amp;nbsp;(&lt;a href="last3hours_raw_wind.csv"&gt;Raw Wind CSV&lt;/a&gt;)(&lt;a href="/faq/#6.10"&gt;?&lt;/a&gt;)&lt;/th&gt;&lt;/tr&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload