SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
CGI.pm — зло?!
CGI.pm
Lincoln D. Stein
131(76)
3.37
23 апреля 2008
245 КБ
4087
174+
480 стр
Возможности
• ООП и ФОП
• генерация (x)html
• поддержка mod_perl, XForms, server-push
• совместимость с cgi-lib.pl
• поддержка мелочей (IE 3.01 Macintosh)
• магия, много магии (174+)
Баги
121
Недостатки
• Vars теряет доступ к FH
• одновременно GET и POST параметры
• ProgressBar?!
• некорректная работа с UTF-8
• mod_perl повсюду
• медленная загрузка в память
POE
1
    my $q;
    if ( $request->method() eq 'POST' ) {
        $q = new CGI( $request->content );
    }
    else {
        $request->uri() =~ /?(.+$)/;
        if ( defined($1) ) {
            $q = new CGI( $1 );
        }
        else {
            $q = new CGI;
        }
    }
2
    local %ENV;

    ...
    $ENV{REQUEST_METHOD} = $request->method;
    $ENV{QUERY_STRING} = $uri->query;
    $ENV{COOKIE} = $request->header('Cookie');
    ...

    our $content = $request->content;
    tie *STDIN, 'IO::Scalar', $content;

    my $q = new CGI;
Альтернативы
• CGI::Simple
• CGI::Minimal
• CGI::Lite
• CGI::EasyCGI
• CGI::WebIn
• CGI::Thin
“use CGI or die”
Идеальный
“CGI.pm”
• разбор запроса независимо от интерфейса
• CGI, mod_perl, FastCGI, POE и etc.
• ProgressBar!
• XForms, server-push и etc.
• просто, легко и быстро :)
*::CGI


  
    my $self = shift->SUPER::new(
  
   
 ...
  
   
 'method' => $ENV{'REQUEST_METHOD'},
  
   
 'query' => $ENV{'QUERY_STRING'} ||
                       $ENV{'REDIRECT_QUERY_STRING'},
  
   
 'type'     => $ENV{'CONTENT_TYPE'},
  
   
 'length' => $ENV{'CONTENT_LENGTH'},
  
   
 'stream' =>*STDIN,
  
    );
  
    $self->parse;
*::ModPerl
    my $REQUEST = ({
   
 1 => sub {
   
 
 require Apache;
   
 
 my $r = shift || Apache->request || return;
   
 
 $r->register_cleanup(sub {1});
   
 
 return $r;
   
 },
   
 2 => sub { ... }
     })->{
   
 $ENV{'MOD_PERL'}
     &&
   
 $ENV{'MOD_PERL_API_VERSION'}
    };
*::ModPerl


   
    my $self = shift->SUPER::new(
   
   
 ...
   
   
 'method' => $REQUEST ? $REQUEST->method : ...,
   
   
 'query' => $REQUEST ? $REQUEST->args : ...,

   
   
   'type'   => $ENV{'CONTENT_TYPE'},
   
   
   'length' => $ENV{'CONTENT_LENGTH'},
   
   
   'stream' =>*STDIN,
   
    );
   
    $self->parse;
*::FCGI
   use FCGI;
   our $REQUEST;
   BEGIN {
   
 $REQUEST =
   
 
 $ENV{'FCGI_SOCKET_PATH'}
   
 ?
   
 
 FCGI::Request(undef, undef, undef, undef,
   
 
   FCGI::OpenSocket($ENV{'FCGI_SOCKET_PATH'},
   
 
 
 ($ENV{'FCGI_LISTEN_QUEUE'} || 100)),
   
 
   FCGI::FAIL_ACCEPT_ON_INTR
   
 
 )
   
 :
   
 
 FCGI::Request;
   }
*::FCGI

  
        $self->{'request'} = $REQUEST;

  
        ...

  
        $self->{'request'}
       ?
  
        $self->{'request'}->Accept >= 0
       :
  
        FCGI::accept >= 0;
   
  
        ...
*::POE




   
     my $REQUEST = ...; # HTTP::Request
   
   
     ...

   
     open my $STREAM, '<', ($REQUEST->content || '');
*::POE


  
    my $self = shift->SUPER::new(
  
   
 ...
  
   
 'method' => $REQUEST->method,
  
   
 'query' => URI->new($REQUEST->uri)->query,

  
   
   'type'   => join('; ', $REQUEST->content_type),
  
   
   'length' => $REQUEST->content_length,
  
   
   'stream' => $STREAM,
  
    );
  
    $self->parse;
CGI.pm — зло !
CGI.pm — зло?!
Анатолий Шарифулин
  RostovOnDon.pm
        2008

Mais conteúdo relacionado

Mais procurados

Pemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionPemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionNur Fadli Utomo
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dkStan Adrian
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleIan Barber
 
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard InterfacesDecoupling Objects With Standard Interfaces
Decoupling Objects With Standard InterfacesThomas Weinert
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with PuppetOlinData
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with PuppetWalter Heck
 
Pemrograman Web 8 - MySQL
Pemrograman Web 8 - MySQLPemrograman Web 8 - MySQL
Pemrograman Web 8 - MySQLNur Fadli Utomo
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challengervanphp
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The AnswerIan Barber
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample PhpJH Lee
 
Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Yusuke Wada
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
Google Cloud Challenge - PHP - DevFest GDG-Cairo
Google Cloud Challenge - PHP - DevFest GDG-Cairo Google Cloud Challenge - PHP - DevFest GDG-Cairo
Google Cloud Challenge - PHP - DevFest GDG-Cairo Haitham Nabil
 
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tMojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tCosimo Streppone
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionIan Barber
 
The promise of asynchronous PHP
The promise of asynchronous PHPThe promise of asynchronous PHP
The promise of asynchronous PHPWim Godden
 

Mais procurados (20)

Pemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionPemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan Session
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dk
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard InterfacesDecoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
 
Pemrograman Web 8 - MySQL
Pemrograman Web 8 - MySQLPemrograman Web 8 - MySQL
Pemrograman Web 8 - MySQL
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challenger
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample Php
 
Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5
 
M.php
M.phpM.php
M.php
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
Google Cloud Challenge - PHP - DevFest GDG-Cairo
Google Cloud Challenge - PHP - DevFest GDG-Cairo Google Cloud Challenge - PHP - DevFest GDG-Cairo
Google Cloud Challenge - PHP - DevFest GDG-Cairo
 
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tMojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
 
Shell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbaiShell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbai
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
 
The promise of asynchronous PHP
The promise of asynchronous PHPThe promise of asynchronous PHP
The promise of asynchronous PHP
 

Semelhante a CGI.pm - 3ло?!

Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Anatoly Sharifulin
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnSandro Zaccarini
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめようYuriko IKEDA
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hopeMarcus Ramberg
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server Masahiro Nagano
 
Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked aboutacme
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shellady36
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2ady36
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...DoktorMandrake
 

Semelhante a CGI.pm - 3ло?! (20)

R57.Php
R57.PhpR57.Php
R57.Php
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
 
Php
PhpPhp
Php
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめよう
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
 
Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked about
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shell
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...
 
Perl Web Client
Perl Web ClientPerl Web Client
Perl Web Client
 

Mais de Anatoly Sharifulin

Ещё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхЕщё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхAnatoly Sharifulin
 
ASO Аудит для приложений и игр
ASO Аудит для приложений и игрASO Аудит для приложений и игр
ASO Аудит для приложений и игрAnatoly Sharifulin
 
ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)Anatoly Sharifulin
 
AppFollow митап в Москве
AppFollow митап в МосквеAppFollow митап в Москве
AppFollow митап в МосквеAnatoly Sharifulin
 
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...Anatoly Sharifulin
 
Аналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayАналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayAnatoly Sharifulin
 
Конкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийКонкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийAnatoly Sharifulin
 
Аналитика приложений конкурентов
Аналитика приложений конкурентовАналитика приложений конкурентов
Аналитика приложений конкурентовAnatoly Sharifulin
 
Аналитика магазинов приложений
Аналитика магазинов приложенийАналитика магазинов приложений
Аналитика магазинов приложенийAnatoly Sharifulin
 
Аналитика мобильных приложений
Аналитика мобильных приложенийАналитика мобильных приложений
Аналитика мобильных приложенийAnatoly Sharifulin
 
Анализ приложений конкурентов
Анализ приложений конкурентовАнализ приложений конкурентов
Анализ приложений конкурентовAnatoly Sharifulin
 
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»Anatoly Sharifulin
 
Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Anatoly Sharifulin
 
Основной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruОсновной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruAnatoly Sharifulin
 
ASO оптимизация и продвижение мобильных приложений
ASO  оптимизация и продвижение мобильных приложенийASO  оптимизация и продвижение мобильных приложений
ASO оптимизация и продвижение мобильных приложенийAnatoly Sharifulin
 

Mais de Anatoly Sharifulin (20)

Ещё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхЕщё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играх
 
ASO Аудит для приложений и игр
ASO Аудит для приложений и игрASO Аудит для приложений и игр
ASO Аудит для приложений и игр
 
ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)
 
ASO для iOS 11
ASO для iOS 11ASO для iOS 11
ASO для iOS 11
 
AppFollow митап в Москве
AppFollow митап в МосквеAppFollow митап в Москве
AppFollow митап в Москве
 
ASO Best Practices 2016
ASO Best Practices 2016ASO Best Practices 2016
ASO Best Practices 2016
 
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
 
Аналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayАналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google Play
 
ASO FAQ
ASO FAQASO FAQ
ASO FAQ
 
ASO: Best Practices 2015
ASO: Best Practices 2015ASO: Best Practices 2015
ASO: Best Practices 2015
 
AppFollow Demo Day ФРИИ
AppFollow Demo Day ФРИИAppFollow Demo Day ФРИИ
AppFollow Demo Day ФРИИ
 
Конкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийКонкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложений
 
Аналитика приложений конкурентов
Аналитика приложений конкурентовАналитика приложений конкурентов
Аналитика приложений конкурентов
 
Аналитика магазинов приложений
Аналитика магазинов приложенийАналитика магазинов приложений
Аналитика магазинов приложений
 
Аналитика мобильных приложений
Аналитика мобильных приложенийАналитика мобильных приложений
Аналитика мобильных приложений
 
Анализ приложений конкурентов
Анализ приложений конкурентовАнализ приложений конкурентов
Анализ приложений конкурентов
 
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
 
Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?
 
Основной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruОсновной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ru
 
ASO оптимизация и продвижение мобильных приложений
ASO  оптимизация и продвижение мобильных приложенийASO  оптимизация и продвижение мобильных приложений
ASO оптимизация и продвижение мобильных приложений
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

CGI.pm - 3ло?!

  • 5.
  • 12. • ООП и ФОП • генерация (x)html • поддержка mod_perl, XForms, server-push • совместимость с cgi-lib.pl • поддержка мелочей (IE 3.01 Macintosh) • магия, много магии (174+)
  • 14. 121
  • 16. • Vars теряет доступ к FH • одновременно GET и POST параметры • ProgressBar?! • некорректная работа с UTF-8 • mod_perl повсюду • медленная загрузка в память
  • 17. POE
  • 18. 1 my $q; if ( $request->method() eq 'POST' ) { $q = new CGI( $request->content ); } else { $request->uri() =~ /?(.+$)/; if ( defined($1) ) { $q = new CGI( $1 ); } else { $q = new CGI; } }
  • 19. 2 local %ENV; ... $ENV{REQUEST_METHOD} = $request->method; $ENV{QUERY_STRING} = $uri->query; $ENV{COOKIE} = $request->header('Cookie'); ... our $content = $request->content; tie *STDIN, 'IO::Scalar', $content; my $q = new CGI;
  • 21. • CGI::Simple • CGI::Minimal • CGI::Lite • CGI::EasyCGI • CGI::WebIn • CGI::Thin
  • 22. “use CGI or die”
  • 24. • разбор запроса независимо от интерфейса • CGI, mod_perl, FastCGI, POE и etc. • ProgressBar! • XForms, server-push и etc. • просто, легко и быстро :)
  • 25. *::CGI my $self = shift->SUPER::new( ... 'method' => $ENV{'REQUEST_METHOD'}, 'query' => $ENV{'QUERY_STRING'} || $ENV{'REDIRECT_QUERY_STRING'}, 'type' => $ENV{'CONTENT_TYPE'}, 'length' => $ENV{'CONTENT_LENGTH'}, 'stream' =>*STDIN, ); $self->parse;
  • 26. *::ModPerl my $REQUEST = ({ 1 => sub { require Apache; my $r = shift || Apache->request || return; $r->register_cleanup(sub {1}); return $r; }, 2 => sub { ... } })->{ $ENV{'MOD_PERL'} && $ENV{'MOD_PERL_API_VERSION'} };
  • 27. *::ModPerl my $self = shift->SUPER::new( ... 'method' => $REQUEST ? $REQUEST->method : ..., 'query' => $REQUEST ? $REQUEST->args : ..., 'type' => $ENV{'CONTENT_TYPE'}, 'length' => $ENV{'CONTENT_LENGTH'}, 'stream' =>*STDIN, ); $self->parse;
  • 28. *::FCGI use FCGI; our $REQUEST; BEGIN { $REQUEST = $ENV{'FCGI_SOCKET_PATH'} ? FCGI::Request(undef, undef, undef, undef, FCGI::OpenSocket($ENV{'FCGI_SOCKET_PATH'}, ($ENV{'FCGI_LISTEN_QUEUE'} || 100)), FCGI::FAIL_ACCEPT_ON_INTR ) : FCGI::Request; }
  • 29. *::FCGI $self->{'request'} = $REQUEST; ... $self->{'request'} ? $self->{'request'}->Accept >= 0 : FCGI::accept >= 0; ...
  • 30. *::POE my $REQUEST = ...; # HTTP::Request ... open my $STREAM, '<', ($REQUEST->content || '');
  • 31. *::POE my $self = shift->SUPER::new( ... 'method' => $REQUEST->method, 'query' => URI->new($REQUEST->uri)->query, 'type' => join('; ', $REQUEST->content_type), 'length' => $REQUEST->content_length, 'stream' => $STREAM, ); $self->parse;