#!/usr/local/bin/perl $|++; #dont't buffer output use strict; # file name:: pod_html.pl # Created on Tuesday, December 19, 2000 using # Perl Studio by AyerSoft copyright(C) 2000 ################################################### # You are free to customize this script as you wish, and # redistribute it without written permission from AyerSoft. # DISCLAIMER # The information and code provided is provided 'as is' without # warranty of any kind, either express or implied. In no event # shall the AyerSoft Company be liable for any damages whatsoever # including direct, indirect, incidental, consequential, loss of # business profits or special damages, even if the author has been # advised of the possibility of such damages. # DO NOT USE THIS SCRIPT UNLESS YOU CAN FULLY AGREE WITH THIS # DISCLAIMER. ################################################### use Pod::Html; # main program code #======================================================================================= #create the html files from a directory of pod files &get_pod_files("C:/Pod/","C:/Pod/html/"); print "done"; exit; ##################################################################################### # library subroutines follow ##################################################################################### ##################################################################################### # FUNCTION get_pod_files # RECEIVES root directory with trailing slash # out directory to store/create the html files created from the pod files # RETURNS 1|0 for success # PURPOSE Creates the html files from a directory of pod files. #======================================================================================= sub get_pod_files{ my $root = shift; my $outDir = shift; my @files; my @htmlfiles; my @dirs; my $dir; my %ret; $root =~ s{\\}{/}g; unless(opendir(DIR, $root)) { $! = "Can't open directory $root\n"; return undef; } @files = readdir(DIR); @htmlfiles = grep {/\.pod?/i} @files; closedir(DIR); foreach $f(@htmlfiles ){ $file = $root .$f; $out = $f; $out =~ s/pod/html/; $outfile = $outDir .$out; pod2html("--infile=$file", "--outfile=$outfile"); } }