This manual page is for Mac OS X version 10.6

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



CGI::Pretty(3pm)                      Perl Programmers Reference Guide                      CGI::Pretty(3pm)



NAME
       CGI::Pretty - module to produce nicely formatted HTML code

SYNOPSIS
           use CGI::Pretty qw( :html3 );

           # Print a table with a single data element
           print table( TR( td( "foo" ) ) );

DESCRIPTION
       CGI::Pretty is a module that derives from CGI.  It's sole function is to allow users of CGI to output
       nicely formatted HTML code.

       When using the CGI module, the following code:
           print table( TR( td( "foo" ) ) );

       produces the following output:
           <TABLE><TR><TD>foo</TD></TR></TABLE>

       If a user were to create a table consisting of many rows and many columns, the resultant HTML code
       would be quite difficult to read since it has no carriage returns or indentation.

       CGI::Pretty fixes this problem.  What it does is add a carriage return and indentation to the HTML
       code so that one can easily read it.

           print table( TR( td( "foo" ) ) );

       now produces the following output:
           <TABLE>
              <TR>
                 <TD>
                    foo
                 </TD>
              </TR>
           </TABLE>

       Tags that won't be formatted

       The <A> and <PRE> tags are not formatted.  If these tags were formatted, the user would see the extra
       indentation on the web browser causing the page to look different than what would be expected.  If
       you wish to add more tags to the list of tags that are not to be touched, push them onto the @AS_IS
       array:

           push @CGI::Pretty::AS_IS,qw(CODE XMP);

       Customizing the Indenting

       If you wish to have your own personal style of indenting, you can change the $INDENT variable:

           $CGI::Pretty::INDENT = "\t\t";

       would cause the indents to be two tabs.

       Similarly, if you wish to have more space between lines, you may change the $LINEBREAK variable:

           $CGI::Pretty::LINEBREAK = "\n\n";

       would create two carriage returns between lines.

       If you decide you want to use the regular CGI indenting, you can easily do the following:

           $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = "";

BUGS
       This section intentionally left blank.

AUTHOR
       Brian Paulsen <[email protected]>, with minor modifications by Lincoln Stein <[email protected]>
       for incorporation into the CGI.pm distribution.

       Copyright 1999, Brian Paulsen.  All rights reserved.

       This library is free software; you can redistribute it and/or modify it under the same terms as Perl
       itself.

       Bug reports and comments to [email protected].  You can also write to [email protected], but this
       code looks pretty hairy to me and I'm not sure I understand it!

SEE ALSO
       CGI



perl v5.10.0                                     2007-12-18                                 CGI::Pretty(3pm)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the Perl project. (See perlbug(1) for submission instructions.)
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the Perl project using perlbug(1).
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.