diff _test/any.t @ 10:63f6653b094e

DOM
author Sergey
date Fri, 28 Aug 2009 16:26:20 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_test/any.t	Fri Aug 28 16:26:20 2009 +0400
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+#use strict;
+
+use HTML::Element;
+$a = HTML::Element->new('a', href => 'http://www.perl.com/');
+$a->push_content("The Perl Homepage");
+
+$tag = $a->tag;
+print "$tag starts out as:",  $a->starttag, "\n";
+print "$tag ends as:",  $a->endtag, "\n";
+print "$tag\'s href attribute is: ", $a->attr('href'), "\n";
+
+$links_r = $a->extract_links();
+print "Hey, I found ", scalar(@$links_r), " links.\n";
+
+print "And that, as HTML, is: ", $a->as_HTML, "\n";
+$a = $a->delete;
+
+