- or download this
use strict;
use warnings;
use diagnostics;
...
}
}
}
- or download this
foreach my $file_name (@ARGV) {
my $tree = HTML::TreeBuilder->new ;
$tree->parse_file($file_name);
...
$tree = $tree->delete ;
close OUTPUT_FILE or die $!;
}
- or download this
sub traverse ($) {
my $element = $_[0] ;
if ($element) {
...
}
return $element ;
}
- or download this
C:\ ... \Programs\HTMLify>htmlify3.pl test.html
...
Processing a string element...
“I’m really happy!”
- or download this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
...
<p>"I'm really happy!"</p>
</body>
</html>
- or download this
sub traverse ($) {
my $element = $_[0] ;
if ($element) {
...
}
return $element ;
}
- or download this
{
my @contents = $_->content_list() ;
print STDERR "before: @contents\n";
...
$_->detach_content();
$_->push_content(@contents);
}
- or download this
sub traverse {
for my $element (@_) {
if (Scalar::Util::blessed ($element)) {
...
}
}
}
- or download this
sub traverse {
my $element = $_[0] ;
if (Scalar::Util::blessed ($element)) {
...
print $element, "\n\n" ;
}
}
- or download this
sub traverse {
my $element = $_[0] ;
if (Scalar::Util::blessed (${element})) {
...
print ${element}, "\n\n" ;
}
}