@kyanny's blog

My thoughts, my life. Views/opinions are my own.

HTML::Element#as_Lisp_form

S式で出力できるらしい。ちゃんと入れ子をインデントで表現してくれるw

$ perl -mHTML::Element -le '$p = HTML::Element->new(q{p}); $a = HTML::Element->new(q{a}, href => q{http://google.com/}); $p->push_content($a); print $p->as_Lisp_form()'
("_tag" "p" "_content" (
  ("_tag" "a" "href" "http://google.com/")))