comparison _test/any.t @ 10:63f6653b094e

DOM
author Sergey
date Fri, 28 Aug 2009 16:26:20 +0400
parents
children
comparison
equal deleted inserted replaced
9:5899df8c289e 10:63f6653b094e
1 #!/usr/bin/perl -w
2 #use strict;
3
4 use HTML::Element;
5 $a = HTML::Element->new('a', href => 'http://www.perl.com/');
6 $a->push_content("The Perl Homepage");
7
8 $tag = $a->tag;
9 print "$tag starts out as:", $a->starttag, "\n";
10 print "$tag ends as:", $a->endtag, "\n";
11 print "$tag\'s href attribute is: ", $a->attr('href'), "\n";
12
13 $links_r = $a->extract_links();
14 print "Hey, I found ", scalar(@$links_r), " links.\n";
15
16 print "And that, as HTML, is: ", $a->as_HTML, "\n";
17 $a = $a->delete;
18
19