翻訳と辞書
Words near each other
・ CH Madrid
・ Ch Muhammed Saeed
・ CH Politehnica Timișoara
・ CH postcode area
・ CH Sevilla
・ CH star
・ CH Valladolid
・ Ch!pz
・ Ch'aki Mayu (Cochabamba)
・ Ch'aki Mayu (Potosí)
・ Ch'aki Qucha
・ Ch'akiqucha
・ Ch'alla Phujru
・ CGI
・ CGI Group
CGI.pm
・ Cgiapp
・ CGIAR
・ CGIAR Consortium of International Agricultural Research Centers
・ Cgidev2
・ CGIProxy
・ CGIS
・ CGK733 fraud
・ CGL
・ CGM
・ Cgm 558
・ CGM Gallagher
・ CGMC
・ CGMP
・ CGMP-dependent protein kinase


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

CGI.pm : ウィキペディア英語版
CGI.pm

CGI.pm is a large and widely used Perl module for programming Common Gateway Interface (CGI) web applications, providing a consistent API for receiving and processing user input. There are also functions for producing HTML or XHTML output, but these are now unmaintained and are to be avoided.〔https://metacpan.org/pod/distribution/CGI/lib/CGI.pod#HTML-Generation-functions-should-no-longer-be-used〕 CGI.pm was a core perl module but has been removed as of v5.22 of perl.〔https://metacpan.org/pod/distribution/CGI/lib/CGI.pod#CGI.pm-HAS-BEEN-REMOVED-FROM-THE-PERL-CORE〕 The module was written by Lincoln Stein and is now maintained by Lee Johnson.
== Examples ==
Here is a simple CGI page, written in Perl using CGI.pm (in object-oriented style):

#!/usr/bin/env perl
use strict;
use warnings;
use CGI;
my $cgi = CGI->new;
print $cgi->header('text/html');
print << "EndOfHTML";
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>


A Simple CGI Page



A Simple CGI Page



Name:

Age:






EndOfHTML
if ( my $name = $cgi->param('name') )
if ( my $age = $cgi->param('age') )
print '';

This would print a very simple webform, asking for your name and age, and after having been submitted, redisplaying the form with the name and age displayed below it. This sample makes use of CGI.pm's object-oriented abilities; it can also be done by calling functions directly, without the $cgi->, however the necessary functions must be imported into the namespace of the script that requires access to those functions:

#!perl
use strict;
use warnings;
use CGI qw/ :standard /;
my $cgi = CGI->new;
print header('text/html');
# ... HTML output same as above example
if ( my $name = param('name') )
if ( my $age = param('age') )
print '';

Note: in many examples $q, short for query, is used to store a CGI object. As the above example illustrates, this might be very misleading.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「CGI.pm」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.