| 1 | #!/usr/local/bin/perl | ||||||||||
| 2 | |||||||||||
| 3 | 18 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 18 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 18 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 18 | ▶ | use Getopt::Long; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 18 | ▶ | use Pod::Tree::HTML; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 18 | my %Options; | |||||||||
| 10 | 18 | $Options{toc} = 1; | |||||||||
| 11 | 18 | my $ok = GetOptions( \%Options, "base:s", "css:s", "toc!", "hr:i", "bgcolor:s", "text:s", "variables:s" ); | |||||||||
| 12 | 18 | ▶ | $ok or die "Bad command line options\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | |||||||||||
| 14 | 18 | umask 0022; | |||||||||
| 15 | |||||||||||
| 16 | 18 | ▶ | @ARGV < 2 and die "podtree2html PODfile HTMLfile [templateFile]\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 18 | my ( $source, $dest, $template, @variables ) = @ARGV; | |||||||||
| 18 | 18 | my $html = Pod::Tree::HTML->new( $source, $dest ); | |||||||||
| 19 | 18 | $html->set_options(%Options); | |||||||||
| 20 | |||||||||||
| 21 | 18 | ▶ | do $Options{variables} if $Options{variables}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 18 | for (@variables) { | |||||||||
| 24 | 6 | chomp; | |||||||||
| 25 | 6 | my ( $name, $value ) = split /=/, $_, 2; | |||||||||
| 26 | 6 | $name =~ s(^\$)(); | |||||||||
| 27 | 6 | ${ $Pod::Tree::HTML::{$name} } = $value; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 18 | $html->translate($template); | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||