chdir(dirname($0));
($file = basename($0)) =~ s/\.PL$//;
$file =~ s/\.pl$//
- if ($Config{'osname'} eq 'VMS' or
- $Config{'osname'} eq 'OS2'); # "case-forgiving"
+ if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving"
open OUT,">$file" or die "Can't create $file: $!";
# You can use $Config{...} to use Configure variables.
print OUT <<"!GROK!THIS!";
-$Config{'startperl'}
+$Config{startperl}
+ eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
!GROK!THIS!
# In the following, perl variables are not expanded during extraction.
print OUT <<'!NO!SUBS!';
-eval 'exec perl -S $0 ${1+"$@"}'
- if $running_under_some_shell;
+
#
# pod2html - convert pod format to html
# Version 1.15
# loop twice through the pods, first to learn the links, then to produce html
for $count (0,1) {
- print STTDER "Scanning pods...\n" unless $count;
+ print STDERR "Scanning pods...\n" unless $count;
foreach $podfh ( @Pods ) {
- ($pod = $podfh) =~ s/\.pod$//;
+ ($pod = $podfh) =~ s/\.(?:pod|pm)$//;
Debug("files", "opening 2 $podfh" );
print "Creating $pod.html from $podfh\n" if $count;
$RS = "\n="; # grok pods by item (Nonstandard but effecient)
open(HTML,">$html") || die "can't create $html: $ERRNO";
print HTML '<!-- $Id$ -->',"\n",'<HTML><HEAD>',"\n";
print HTML "<CENTER>" unless $NO_NS;
- print HTML "<TITLE>$pod</TITLE>\n</HEAD>\n<BODY>";
+ print HTML "<TITLE>$pod</TITLE>";
print HTML "</CENTER>" unless $NO_NS;
+ print HTML "\n</HEAD>\n<BODY>";
}
for ($i = 0; $i <= $#all; $i++) { # decide what to do with each chunk
$all[$i] =~ /^(\w+)\s*(.*)\n?([^\0]*)$/ ;
if ($count) { # producing html
($depth) or next; # just skip it
do_list("back",$all[$i+1],\$in_list,\$depth);
- do_rest("$title.$rest");
+ do_rest($title.$rest);
}
}
elsif ($cmd =~ /^cut/) {
if ($count) { # producing html
if ($title =~ s/^html//) {
$in_html =1;
- do_rest("$title.$rest");
+ do_rest($title.$rest);
}
}
}
my($cmd,$title,$pod) = @_;
$_ = $title;
s/\n$//;
+ s/E<(\d+)>/&#$1;/g;
s/E<(.*?)>/&$1;/g;
# remove any formatting information for the headers
s/[SFCBI]<(.*?)>/$1/g;
}
}
if (length($key)) {
- ($pod2,$num) = split(/_/,$value,2);
+ ($pod2, $num) = $value =~ /^(.*)_(\S+_\d+)$/;
if ($htype eq "NAME") {
return "\n<A NAME=\"".$value."\">\n$bigkey</A>\n"
}
sub pre_escapes { # twiddle these, and stay up late :-)
my($thing) = @_;
for ($$thing) {
+ s/([\200-\377])/noremap("&".ord($1).";")/ge;
s/"(.*?)"/``$1''/gs;
s/&/noremap("&")/ge;
s/<</noremap("<<")/eg;
s/([^ESIBLCF])</$1\<\;/g;
+ s/E<(\d+)>/\&#$1\;/g; # embedded numeric special
s/E<([^\/][^<>]*)>/\&$1\;/g; # embedded special
}
}