#! /usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use HTML::LinkExtor; my $url = "http://www.perl-community.de/index.shtml"; # neues cgi-objekt erstellen my $cgi = CGI->new(); print $cgi->header(); # gibt http-header aus print $cgi->start_html(); # gibt ... aus # webseite laden und parsen my $parser = HTML::LinkExtor->new(undef, $url); $parser->parse_file($filename); my @links = $parser->links; foreach $linkarray (@links) { my ($eltType, @element) = @$linkarray; # possibly test whether this is an element we're interested in while (@element) { # extract the next attribute and its value my ($attr_name, $attr_value) = splice(@element, 0, 2); # mach was mit $attr_name und $attr_value, z.b. print "$eltType: $attr_name => $attr_value
\n"; } # while } # foreach # ausgeben print $cgi->end_html();