Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    use diagnostics;
    ...
        }
      }
    }
    
  2. 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 $!;
    }
    
  3. or download this
    sub traverse ($) {
      my $element = $_[0] ;
      if ($element) {
    ...
      }
      return $element ;
    }
    
  4. or download this
    C:\ ... \Programs\HTMLify>htmlify3.pl test.html
    
    ...
    
    Processing a string element...
    “I’m really happy!”
    
  5. 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>
    
  6. or download this
    sub traverse ($) {
      my $element = $_[0] ;
      if ($element) {
    ...
      }
      return $element ;
    }
    
  7. or download this
    {
                my @contents = $_->content_list() ;
                print STDERR "before: @contents\n";
    ...
                $_->detach_content();
                $_->push_content(@contents);
            }
    
  8. or download this
    sub traverse {
      for my $element (@_) {
        if (Scalar::Util::blessed ($element)) {
    ...
        }
      }
    }
    
  9. or download this
    sub traverse {
      my $element = $_[0] ;
      if (Scalar::Util::blessed ($element)) {
    ...
        print $element, "\n\n" ;
      }
    }
    
  10. or download this
    sub traverse {
      my $element = $_[0] ;
      if (Scalar::Util::blessed (${element})) {
    ...
        print ${element}, "\n\n" ;
      }
    }