Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



8.38. CGI::Pretty


Allows
users of CGI to output nicely formatted HTML code by adding carriage
returns and indentations to HTML markup for easy readability. For
example, the following code:

#!/usr/local/bin/perl -w
use CGI qw(:all);
my $query = CGI->new( );
print $query->start_html( );
print $query->table( TR( td( "foo" ) ) );
print $query->end_html( );

outputs the following HTML:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>Untitled Document</title>
</head><body><table><tr><td>foo</td></tr></table></body></html>

which is ugly. You can make it prettier with CGI::Pretty:

#!/usr/local/bin/perl -w
use CGI::Pretty qw( :html3 );
my $query = CGI->new( );
print $query->start_html( );
# Print a table with a single data element
print $query->table( TR( td( "foo" ) ) );
print $query->end_html( );



8.37. CGI::Fast8.39. CGI::Push




Copyright © 2002 O'Reilly & Associates. All rights reserved.

/ 875