CGI::Pretty man page on AIX

Man page or keyword search:  
man Server   4752 pages
apropos Keyword Search (all sections)
Output format
AIX logo
[printable version]

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

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

	   use CGI::Pretty qw( :html3 );

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

       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:

       If a user were to create a table consisting of many rows and many col‐
       umns, 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:

       Tags that won't be formatted

       The <A> and <PRE> tags are not formatted.  If these tags were format‐
       ted, the user would see the extra indentation on the web browser caus‐
       ing 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 = "";

       This section intentionally left blank.

       Brian Paulsen <>, with minor modifications by Lin‐
       coln Stein <> for incorporation into the distri‐

       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  You can also write
       to, but this code looks pretty hairy to me and I'm not
       sure I understand it!


perl v5.8.8			  2008-09-19			CGI::Pretty(3)
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server AIX

List of man pages available for AIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net