#!/usr/bin/env perl
my
$source
=
<<HTML;
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>addClass demo</title>
<style>
p {
margin: 8px;
font-size: 16px;
}
.selected {
color: blue;
}
.highlight {
background: yellow;
}
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<p>Hello</p>
<p>and</p>
<p>Goodbye</p>
<script>
\$( "p" ).last().addClass( "selected" );
</script>
</body>
</html>
HTML
my
$subs
= {
q1_jquery
=> create(\
&j
),
web_query_libxml
=> create(\
&wq
),
jquery
=> create(\
&jquery
)
};
foreach
my
$name
(
keys
%$subs
) {
my
$obj
=
$subs
->{
$name
}->();
}
cmpthese(
shift
|| 1000,
$subs
);
sub
create {
my
$obj
=
shift
;
sub
{
$obj
->(
$source
)
}
}