On 21/08/2013 18:32, Natxo Asenjo wrote:
hi,
thanks all for your advice. I have just used one of your suggested
regex to accomplish this task:
if ( $text =~ /.*(critical alarm.*?)\./i ) {
my $message = $1;
print $message, "\n";
}
This captures everything starting with critical alarm until it finds a
dot (non greedy).
I agree with Rob Dixon I should be parsing the html, but unfortunately
getting it was proving more complicated than this. If this check
breaks with a firmware update then we will have to see wat we do then,
these things do not get updates so often, fortunately.
There is no problem getting the HTML of the page.
In the same place where you have
$mech->text
you can write
$mech->content
and you will get the unparsed HTML instead of the text will the HTML
stripped out.
HTH,
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/