Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
my first 2-html html::zoom thing
#!/usr/bin/perl
use strict;
use warnings;
use HTML::Zoom;
my $html = <<HTML;
<html>
<head>
<title>Hello people</title>
</head>
<body>
<div id="content"></div>
</body>
</html>
HTML
my $body = <<HTML;
<h1 id="greeting">Placeholder</h1>
<div id="list">
<span>
<p>Name: <span class="name">Bob</span></p>
<p>Age: <span class="age">23</span></p>
</span>
<hr class="between" />
</div>
HTML
my $html_zoom = HTML::Zoom->from_html($html)
->select('title')
->replace_content('Hello everybody');
my $body_zoom = HTML::Zoom->from_html($body)
->select('#greeting')
->replace_content('Hello everybody')
;
my $sum_zoom = $html_zoom->select('#content')
->append_content($body_zoom->{initial_events})
;
print $sum_zoom->to_html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.