Mixed C/Perl HTML Parser