What is a CGI PERL?
CGI is a communication protocol (a code) through which the HTTP server (or web server) mediates the transfer of information between a program (on the same computer as the server) and an HTTP client (your browser).
Perl is a programming language.
Example CGI PERL code
x
# Comment
print 'Hello World.\n';
print 'Hello World.\n';
Web server is software responsible for accepting HTTP requests from clients, usually browsers, and serving them with HTTP responses, optionally including data, which is usually web pages, such as HTML documents with embedded objects (images, etc.) .
Conditionals if/then/else.
Example CGI IF
x
if ($a)
{
print "A variável não está vazia ";
}
else
{
print "A variável está vazia ";
}
{
print "A variável não está vazia ";
}
else
{
print "A variável está vazia ";
}
erl has the for structure that works the same way as in C.
Example CGI FOR
x
for ($i = 0; $i < 10; ++$i)
# começa com $i = 0
# executa enquanto $i < 10
# incrementa $i antes de repetir
# neste caso $i++ tem o mesmo efeito
{
print "$i ";
}
# começa com $i = 0
# executa enquanto $i < 10
# incrementa $i antes de repetir
# neste caso $i++ tem o mesmo efeito
{
print "$i ";
}
How to do a 301 redirect in CGI