CGI::Pretty - module to produce nicely formatted HTML code
| Use Case | Command | Description |
|---|---|---|
| Pretty-print HTML (deprecated) | use CGI::Pretty; |
⚠️ No longer works – reduced to a shell |
| Alternative: HTML::HTML5::Parser + HTML::HTML5::Writer + XML::LibXML::PrettyPrint | HTML::HTML5::Writer->new(…)->document( XML::LibXML::PrettyPrint->new_for_html(…)->pretty_print(…)) |
✅ Recommended replacement |
| Alternative: Marpa::R2::HTML | html_fmt |
✅ See the html_fmt script for examples |
| Alternative: HTML::Tidy | HTML::Tidy |
✅ |
| Alternative: HTML::Parser | HTML::Parser |
✅ |
CGI::Pretty IS DEPRECATED. It will be removed from the CGI distribution in a future release, so you should no longer use it and remove it from any code that currently uses it.
For now it has been reduced to a shell to prevent your code breaking, but the "pretty" functions will no longer output "pretty" HTML.
print HTML::HTML5::Writer->new(
start_tags => 'force',
end_tags => 'force',
)->document(
XML::LibXML::PrettyPrint->new_for_html( indent_string => "\t" )
->pretty_print(
HTML::HTML5::Parser->new->parse_string( $html_string )
)
);
html_fmt script for examplesperl v5.34.0 2022-02-12 CGI::Pretty(3pm)
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-06 16:24 @2600:1f28:365:80b0:b86a:6c6a:14fb:cc81
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)