[mrtg] Parsing HTML GUI

Mick michaelkintzios at gmail.com
Tue Sep 2 21:29:43 CEST 2008


On Tuesday 02 September 2008, McDonald, Dan wrote:

> # OK, let's convert everything into an array, split on </td> boundaries
>
> my @data = split(qw(</td>),$req->content);
>
> # Then see if we can parse this into something somewhat usable
>
> my ($index, at header,%content);
> $index=0;
> foreach my $datum (@data) {
>    if ( $datum =~ /columnheaderborder/) {
> 	my ($head) = ($datum =~ />(.+?)$/);
> 	push @header,$head;
>    }
>    if ($datum =~ /nowrap="nowrap"/) {
> 	my ($value) = ($datum =~ />(.+?)$/);
> 	$content{$header[$index]} = $value;

It doesn't seem to like this line above. I get:
======================================
$ perl test.1800HG-v00b.pl > test.html
Use of uninitialized value in hash element at test.1800HG-v00b.pl line 41.
Use of uninitialized value in hash element at test.1800HG-v00b.pl line 41.
======================================

Should I email you (off list) the complete html page that it spits out?  Maybe 
easier if you see it in context.

Thanks again for your help.
-- 
Regards,
Mick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20080902/0ca52b94/attachment.bin 


More information about the mrtg mailing list