annotate _test/any.t @ 10:63f6653b094e

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