#!/usr/bin/bash

thing="pl"
style="mypod.css"
back="[TOP]"

dos2unix() {
   cat $1 | perl -e \
    'while($l=<>){$l 
             =~ s/\015\012$/\012/;print($l);}'             
}

for i in $*
do
        if podchecker $i.$thing 
	then
          dos2unix $i.$thing > mypod$$.$thing
          pod2html -back $back         \
                    -css $style        \
                    -title $i          \
                    mypod$$.$thing > $i.html

          #uncomment next line to make text docs	
	  #pod2text prep$$.$thing > $i.txt

	  #uncomment next line to make latex docs
          #pod2latex -o $i.tex prep$$.$thing 

	  rm mypod$$.$thing
       fi 
done