Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  PERL2HTML (1)


perl2html - generates highlighted html-files from Perl source


     Installing as a CGI program
Exit Status
See Also


<B>perl2htmlB> [options] [filename...]


This manual page documents how to use <B>perl2htmlB>. If no arguments are given on the command line of <B>perl2htmlB>, it reads from stdin and writes to stdout.

If invoked with filenames as arguments <B>perl2htmlB> will write it’s output into new files. Names of output files are generated by appending ".html" to the corresponding input filename.

    Installing as a CGI program

<B>perl2htmlB> can be installed as a CGI program and convert source files on the fly. In order to set this up for apache the webmaster has to add the two lines

AddType text/x-perl .pl .pm
Action text/x-perl /cgi-bin/perl2html

to the webserver configuration file. <B>perl2htmlB> depends on the webserver properly setting environment variable PATH_TRANSLATED to the pathname of the source file. If <B>perl2htmlB> has been compiled with option -DCOMPRESSION=1 then it will invoke <B>gzipB> to compress the generated HTML before sending it to the requesting browser. Of course <B>perl2htmlB> takes care to check if the browser accepts gzip encoding.


-- Interpret all following arguments on the command line as filenames. This is useful, if you want to convert files beginning with a ’-’.
-b filename
  Insert the file ’filename’ after converted data and before HTML footer. See also the -s option.
-c Turns off CGI-script detection and HTTP header generation. This is needed to use <B>perl2htmlB> as a subcommand in another CGI script.
-h filename
  Insert the file ’filename’ after the HTML headers and before the converted data. See also the -s option.
-n Number lines and label them with ’line’ followed by the line number. Empty lines get no label, but the linecounter will count them nevertheless. With this feature you can refer to special lines of code from other parts of the generated file or from external files with a line like this:

<A HREF="">Go to line 301</A>

-s With this option you can suppress the generation of HTML headers. This is especially useful together with options -b file and -h file.
-t title
  Set the title to ’title’. The default is the filename you converted or "stdin" if reading from stdin. This option is only used if -s is not set.
-u Print usage information.
-w width
  sets the WIDTH attribute for HTML tag <PRE>. If this option is not used a default of 80 is assumed. (Currently most browsers are ignoring this attribute).
-V reports the version number of <B>perl2htmlB>.


<B>perl2htmlB> returns 0 on success, 1 if input files are not existing/readable, 2 if output files are not creatable/writable, 3 if invoked with illegal options and 4 if <B>gzipB> cannot be invoked.


Florian Schintke <>
Martin Kammerhofer <> wrote the CGI feature.


c2html(1), java2html(1), pas2html(1).

Search for    or go to Top of page |  Section 1 |  Main Index

-*- PERL2HTML (1) "

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.