mojo. Веб в коробке!
DESCRIPTION
Saint Perl 2009TRANSCRIPT
![Page 1: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/1.jpg)
Mojo.Веб в коробке!
Saint Perl 2009
18 декабря 2009 г.
![Page 3: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/3.jpg)
Sebastian Riedelавтор Catalyst и Mojohttp://labs.kraih.com/
18 декабря 2009 г.
![Page 5: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/5.jpg)
Sebastian Riedelавтор Catalyst и Mojohttp://labs.kraih.com/
18 декабря 2009 г.
![Page 6: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/6.jpg)
Sebastian Riedelавтор Catalyst и Mojohttp://labs.kraih.com/
18 декабря 2009 г.
![Page 7: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/7.jpg)
Catalyst + Mojo = ?18 декабря 2009 г.
![Page 8: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/8.jpg)
Что такое Mojo?
18 декабря 2009 г.
![Page 9: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/9.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (начиная с Perl 5.10)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, Daemon и Daemon Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 10: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/10.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, Daemon и Daemon Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 11: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/11.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, Daemon и Daemon Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 12: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/12.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, Daemon и Daemon Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 13: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/13.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, PSGI, Daemon и Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 14: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/14.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, PSGI, Daemon и Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 15: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/15.jpg)
Что такое Mojo?
• Pure Perl веб-фреймворк
• Без зависимостей (с версии Perl 5.8.1)
• Объектно-ориентированное API
• Поддержка HTTP 1.1 (клиент-сервер)
• CGI, FastCGI, PSGI, Daemon и Prefork
• MVC веб-фреймворки: Mojolicious и Mojolicious::Lite
18 декабря 2009 г.
![Page 16: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/16.jpg)
Pure Perl веб-фреймворк
18 декабря 2009 г.
![Page 17: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/17.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 18: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/18.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 19: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/19.jpg)
Minimal Base Class For Mojo Projects
Mojo::Base
18 декабря 2009 г.
![Page 20: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/20.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 21: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/21.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 22: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/22.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 23: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/23.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 24: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/24.jpg)
ByteStream
Mojo::ByteStream
18 декабря 2009 г.
![Page 25: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/25.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 26: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/26.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 27: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/27.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 28: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/28.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 29: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/29.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 30: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/30.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 31: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/31.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 32: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/32.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 33: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/33.jpg)
use Mojo::ByteStream;my $s = Mojo::ByteStream->new('foo_bar');
$s->camelize; $s->decamelize;$s->b64_encode; $s->b64_decode;$s->encode('utf8'); $s->decode('utf8');$s->html_escape; $s->html_unescape;$s->qp_encode; $s->qp_decode;$s->quote; $stream->unquote;$s->url_escape; $s->url_unescape;$s->xml_escape;
18 декабря 2009 г.
![Page 34: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/34.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 35: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/35.jpg)
Perlish Templates!
Mojo::Template
18 декабря 2009 г.
![Page 36: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/36.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 37: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/37.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 38: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/38.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 39: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/39.jpg)
%= my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 40: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/40.jpg)
%== my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 41: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/41.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 42: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/42.jpg)
% use Foo::Bar;
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 43: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/43.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 44: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/44.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 45: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/45.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 46: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/46.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 47: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/47.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%== $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 48: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/48.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <% my $foo = $_->{id} + 100500; %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 49: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/49.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <% my $foo = $_->{id} + 100500; %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 50: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/50.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 51: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/51.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 52: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/52.jpg)
% my $list = $self->stash(‘list’);
<ul>% for (@$list) { <li> <%= $_->{title} %> </li>% }</ul>
<p><%# comment %></p>
18 декабря 2009 г.
![Page 53: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/53.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 54: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/54.jpg)
Minimalistic JSON
Mojo::JSON
18 декабря 2009 г.
![Page 55: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/55.jpg)
my $json = Mojo::JSON->new;
my $string = $json->encode({foo => ‘bar’});
my $hash = $json->decode(‘{"foo":"bar"}’);
18 декабря 2009 г.
![Page 56: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/56.jpg)
my $json = Mojo::JSON->new;
my $string = $json->encode({foo => ‘bar’});
my $hash = $json->decode(‘{"foo":"bar"}’);
18 декабря 2009 г.
![Page 57: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/57.jpg)
my $json = Mojo::JSON->new;
my $string = $json->encode({foo => ‘bar’});
my $hash = $json->decode(‘{"foo":"bar"}’);
18 декабря 2009 г.
![Page 58: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/58.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 59: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/59.jpg)
Class loader: load, reload, search
Mojo::Loader
18 декабря 2009 г.
![Page 60: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/60.jpg)
Class loader: load, reload, search
Mojo::Loader
18 декабря 2009 г.
![Page 61: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/61.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 62: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/62.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 63: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/63.jpg)
• Mojo::Base
• Mojo::ByteStream
• Mojo::Template, Mojo::JSON
• Mojo::Loader, Mojo::Log, Mojo::Path
• Mojo::URL, Mojo::Parameters, Mojo::Content
• Mojo::Message::Request, Mojo::Message::Response,Mojo::Headers, Mojo::Cookie, Mojo::Date
18 декабря 2009 г.
![Page 64: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/64.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 65: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/65.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 66: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/66.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 67: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/67.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 68: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/68.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 69: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/69.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 70: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/70.jpg)
my $client = Mojo::Client->new;
$client->post( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 71: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/71.jpg)
my $client = Mojo::Client->new;
$client->head( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 72: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/72.jpg)
my $client = Mojo::Client->new;
$client->put( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 73: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/73.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 74: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/74.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 75: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/75.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 76: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/76.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 77: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/77.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
18 декабря 2009 г.
![Page 78: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/78.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 79: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/79.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 80: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/80.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 81: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/81.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 82: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/82.jpg)
• Mojo::Trasaction, Mojo::Stateful
• Mojo::IOLoop
• Mojo::Client, Mojo::Server
• Mojo::Server::CGI, Mojo::Server::FastCGI
• Mojo::Server::PSGI
• Mojo::Server::Daemon и ::Prefork
• Mojo::Command
• Mojo::Command::Generate и ~ Server
18 декабря 2009 г.
![Page 83: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/83.jpg)
Mojo – веб в коробке!
Всё, что нужно есть
18 декабря 2009 г.
![Page 84: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/84.jpg)
Mojo – веб в коробке!
Почти всё, что нужно есть :)
18 декабря 2009 г.
![Page 85: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/85.jpg)
Без зависимостейс версии Perl 5.8.1
18 декабря 2009 г.
![Page 86: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/86.jpg)
Почтибез зависимостей :)
18 декабря 2009 г.
![Page 87: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/87.jpg)
Mojo runtime18 декабря 2009 г.
![Page 88: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/88.jpg)
Perl 5.00518 декабря 2009 г.
![Page 89: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/89.jpg)
Perl 5.00600218 декабря 2009 г.
![Page 90: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/90.jpg)
Perl 5.00800118 декабря 2009 г.
![Page 91: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/91.jpg)
Mojo Perl 5.01018 декабря 2009 г.
![Page 92: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/92.jpg)
Объектно-ориентированное API
18 декабря 2009 г.
![Page 93: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/93.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 94: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/94.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 95: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/95.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 96: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/96.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 97: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/97.jpg)
use overload '""' => sub { shift->to_string },
fallback => 1;
18 декабря 2009 г.
![Page 98: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/98.jpg)
GET / HTTP/1.1Connection: keep-aliveAccept: text/html, application/xhtml, ....Accept-Charset: windows-1251, utf-8; ...Accept-Encoding: gzip,deflateAccept-Language: ru,en-us;q=0.7,en;q=0.3Host: localhost:3000User-Agent: Mozilla/5.0 (Macintosh; ...Content-Length: 0Keep-Alive: 300
18 декабря 2009 г.
![Page 99: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/99.jpg)
GET / HTTP/1.1Connection: keep-aliveAccept: text/html, application/xhtml, ....Accept-Charset: windows-1251, utf-8; ...Accept-Encoding: gzip,deflateAccept-Language: ru,en-us;q=0.7,en;q=0.3Host: localhost:3000User-Agent: Mozilla/5.0 (Macintosh; ...Content-Length: 0Keep-Alive: 300
18 декабря 2009 г.
![Page 100: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/100.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 101: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/101.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 102: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/102.jpg)
Генерацияmojo-приложения
18 декабря 2009 г.
![Page 103: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/103.jpg)
mojo generate app TestMojo
[mkdir] test_mojo/script[write] test_mojo/script/test_mojo[chmod] test_mojo/script/test_mojo 744[mkdir] test_mojo/lib[write] test_mojo/lib/TestMojo.pm[mkdir] test_mojo/t[write] test_mojo/t/basic.t
18 декабря 2009 г.
![Page 104: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/104.jpg)
mojo generate app TestMojo
[mkdir] test_mojo/script[write] test_mojo/script/test_mojo[chmod] test_mojo/script/test_mojo 744[mkdir] test_mojo/lib[write] test_mojo/lib/TestMojo.pm[mkdir] test_mojo/t[write] test_mojo/t/basic.t
18 декабря 2009 г.
![Page 105: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/105.jpg)
use FindBin;
use lib "$FindBin::Bin/../lib";use lib "$FindBin::Bin/../../lib";
# Application$ENV{MOJO_APP} ||= 'TestMojo';
use Mojo::Commands;Mojo::Commands->start; # ->start(‘cgi’)
18 декабря 2009 г.
![Page 106: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/106.jpg)
mojo generate app TestMojo
[mkdir] test_mojo/script[write] test_mojo/script/test_mojo[chmod] test_mojo/script/test_mojo 744[mkdir] test_mojo/lib[write] test_mojo/lib/TestMojo.pm[mkdir] test_mojo/t[write] test_mojo/t/basic.t
18 декабря 2009 г.
![Page 107: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/107.jpg)
package TestMojo;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!');}
18 декабря 2009 г.
![Page 108: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/108.jpg)
mojo generate app TestMojo
[mkdir] test_mojo/script[write] test_mojo/script/test_mojo[chmod] test_mojo/script/test_mojo 744[mkdir] test_mojo/lib[write] test_mojo/lib/TestMojo.pm[mkdir] test_mojo/t[write] test_mojo/t/basic.t
18 декабря 2009 г.
![Page 109: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/109.jpg)
#!/usr/bin/env perl
use strict;use warnings;
use Test::More tests => 1;
use_ok('TestMojo');
18 декабря 2009 г.
![Page 110: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/110.jpg)
Поддержка HTTP 1.1
18 декабря 2009 г.
![Page 111: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/111.jpg)
18 декабря 2009 г.
![Page 112: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/112.jpg)
MojoX::UserAgentPascal Gaudette
Спасибо Google of Summer Code 2009!
18 декабря 2009 г.
![Page 113: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/113.jpg)
Поддержка CGI, FastCGI, PSGI,
Daemon, Prefork
18 декабря 2009 г.
![Page 114: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/114.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80
18 декабря 2009 г.
![Page 115: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/115.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80
18 декабря 2009 г.
![Page 116: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/116.jpg)
PATH_INFO='/' script/test_mojo cgi
Легко тестироватьМожно профилировать код, используя Devel::NYProf
18 декабря 2009 г.
![Page 117: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/117.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80
18 декабря 2009 г.
![Page 118: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/118.jpg)
Mojo::Server::FCGIscript/test_mojo fcgiscript/test_mojo fcgi_prefork
18 декабря 2009 г.
![Page 119: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/119.jpg)
Mojo::Server::FCGIscript/test_mojo fcgiscript/test_mojo fcgi_prefork
18 декабря 2009 г.
![Page 120: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/120.jpg)
Mojo::Server::FCGIscript/test_mojo fcgiscript/test_mojo fcgi_prefork
18 декабря 2009 г.
![Page 121: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/121.jpg)
location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length;}
18 декабря 2009 г.
![Page 122: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/122.jpg)
location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length;}
18 декабря 2009 г.
![Page 123: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/123.jpg)
location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length;}
18 декабря 2009 г.
![Page 124: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/124.jpg)
location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length;}
18 декабря 2009 г.
![Page 125: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/125.jpg)
location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length;}
18 декабря 2009 г.
![Page 126: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/126.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80
18 декабря 2009 г.
![Page 127: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/127.jpg)
MOJO_RELOAD=1 script/test_mojo daemon
Код перезагружается при каждом запросе
18 декабря 2009 г.
![Page 128: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/128.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80
18 декабря 2009 г.
![Page 129: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/129.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80script/test_mojo test
18 декабря 2009 г.
![Page 130: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/130.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80script/test_mojo testscript/test_mojo get
18 декабря 2009 г.
![Page 131: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/131.jpg)
script/test_mojo COMMAND [OPTIONS]
script/test_mojo cgiscript/test_mojo fastcgiscript/test_mojo daemonscript/test_mojo daemon_prefork --port 80script/test_mojo testscript/test_mojo get http://goo.gl
18 декабря 2009 г.
![Page 132: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/132.jpg)
MVC веб-фреймворки
18 декабря 2009 г.
![Page 133: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/133.jpg)
Mojolicioususe base 'Mojo';
18 декабря 2009 г.
![Page 134: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/134.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 135: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/135.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 136: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/136.jpg)
Controller Base Class
Mojolicious::Controller
18 декабря 2009 г.
![Page 137: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/137.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 138: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/138.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 139: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/139.jpg)
• render(tempate => ‘foo/bar’)
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 140: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/140.jpg)
• render(controller => ‘foo’, action => ‘bar’)
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 141: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/141.jpg)
• render(‘foo/bar’, format => ‘html)
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 142: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/142.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 143: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/143.jpg)
• render
• render(text => ‘Saint Perl 2009’)
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 144: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/144.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 145: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/145.jpg)
• render
• render_text
• render(json => {foo => ‘bar’})
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 146: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/146.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 147: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/147.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 148: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/148.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 149: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/149.jpg)
• render
• render_text
• render_json
• render_inner
• render_partial
• pause / resume
• redirect_to / url_for
18 декабря 2009 г.
![Page 150: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/150.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 151: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/151.jpg)
Plugin Base Class
Mojolicious::Plugin
18 декабря 2009 г.
![Page 152: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/152.jpg)
Plugins: load_plugin, add_hook, run_hook
Mojolicious::Plugins
18 декабря 2009 г.
![Page 153: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/153.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 154: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/154.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 155: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/155.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 156: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/156.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 157: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/157.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 158: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/158.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 159: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/159.jpg)
• Data::Dumper (Maxdepth: 2, Indent: 1, Terse: 1)
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 160: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/160.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 161: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/161.jpg)
• dumper
• $self->req->param(...)
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 162: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/162.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 163: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/163.jpg)
• dumper
• param
• $self->stash(layout => ...)
• include
• content
• extends
18 декабря 2009 г.
![Page 164: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/164.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 165: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/165.jpg)
• dumper
• param
• layout
• $self->render_partial(...)
• content
• extends
18 декабря 2009 г.
![Page 166: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/166.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 167: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/167.jpg)
• dumper
• param
• layout
• include
• $self->render_inner(...)
• extends
18 декабря 2009 г.
![Page 168: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/168.jpg)
• dumper
• param
• layout
• include
• content
• extends
18 декабря 2009 г.
![Page 169: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/169.jpg)
• dumper
• param
• layout
• include
• content
• $self->stash(extends => ...)
18 декабря 2009 г.
![Page 170: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/170.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 171: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/171.jpg)
• расширение шаблонов .epl
• my $self = shift;
• $self->stash(foo => ‘bar’)
18 декабря 2009 г.
![Page 172: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/172.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 173: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/173.jpg)
• расширение шаблонов .ep
• кеширование шаблонов• $self->stash(foo => ‘bar’) – $foo
• доступны подключенные helper’ы
• обработчик по умолчанию
18 декабря 2009 г.
![Page 174: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/174.jpg)
• AgentCondition
• Charset
• DefaultHelpers
• EpRenderer
• EplRenderer
• RequestTimer
18 декабря 2009 г.
![Page 175: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/175.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 176: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/176.jpg)
script/test_app COMMAND [OPTIONS]
script/test_app cgiscript/test_app fastcgiscript/test_app daemonscript/test_app daemon_prefork --port 80script/test_app testscript/test_app get
18 декабря 2009 г.
![Page 177: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/177.jpg)
script/test_app COMMAND [OPTIONS]
script/test_app cgiscript/test_app fastcgiscript/test_app daemonscript/test_app daemon_prefork --port 80script/test_app testscript/test_app getscritp/test_app routes
18 декабря 2009 г.
![Page 178: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/178.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 179: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/179.jpg)
• Mojolicous::Controller
• Mojolicious::Plugin
• Mojolicious::Commands
• MojoX::Types
• MojoX::Dispatcher, MojoX::Routes
18 декабря 2009 г.
![Page 180: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/180.jpg)
Генерацияmojolicious-приложения
18 декабря 2009 г.
![Page 181: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/181.jpg)
mojolicious generate app TestApp
18 декабря 2009 г.
![Page 182: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/182.jpg)
[mkdir] test_app/script[write] test_app/script/test_app[chmod] test_app/script/test_app 744[mkdir] test_app/lib[write] test_app/lib/TestApp.pm[mkdir] test_app/lib/TestApp[write] test_app/lib/TestApp/Example.pm[mkdir] test_app/t[write] test_app/t/basic.t[mkdir] test_app/log[mkdir] test_app/public[write] test_app/public/404.html[exist] test_app/public[write] test_app/public/500.html
18 декабря 2009 г.
![Page 183: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/183.jpg)
[mkdir] test_app/script[write] test_app/script/test_app[chmod] test_app/script/test_app 744[mkdir] test_app/lib[write] test_app/lib/TestApp.pm[mkdir] test_app/lib/TestApp[write] test_app/lib/TestApp/Example.pm[mkdir] test_app/t[write] test_app/t/basic.t[mkdir] test_app/log[mkdir] test_app/public[write] test_app/public/404.html[exist] test_app/public[write] test_app/public/500.html
18 декабря 2009 г.
![Page 184: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/184.jpg)
[mkdir] test_app/script[write] test_app/script/test_app[chmod] test_app/script/test_app 744[mkdir] test_app/lib[write] test_app/lib/TestApp.pm[mkdir] test_app/lib/TestApp[write] test_app/lib/TestApp/Example.pm[mkdir] test_app/t[write] test_app/t/basic.t[mkdir] test_app/log[mkdir] test_app/public[write] test_app/public/404.html[exist] test_app/public[write] test_app/public/500.html
18 декабря 2009 г.
![Page 185: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/185.jpg)
[mkdir] test_app/script[write] test_app/script/test_app[chmod] test_app/script/test_app 744[mkdir] test_app/lib[write] test_app/lib/TestApp.pm[mkdir] test_app/lib/TestApp[write] test_app/lib/TestApp/Example.pm[mkdir] test_app/t[write] test_app/t/basic.t[mkdir] test_app/log[mkdir] test_app/public[write] test_app/public/404.html[exist] test_app/public[write] test_app/public/500.html
18 декабря 2009 г.
![Page 186: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/186.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 187: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/187.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 188: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/188.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 189: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/189.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 190: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/190.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 191: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/191.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 192: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/192.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->bridge->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 193: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/193.jpg)
package TestApp;
use base 'Mojolicious';sub startup { my $self = shift;
my $r = $self->routes; $r->route('/:controller/:action/:id') ->to(controller => 'example', action => 'welcome', id => 1);}
18 декабря 2009 г.
![Page 194: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/194.jpg)
package TestApp::Example;
use base 'Mojolicious::Controller';sub welcome { my $self = shift; warn $self->stash(‘id’); $self->render(message => 'Welcome!');}
1;
18 декабря 2009 г.
![Page 195: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/195.jpg)
[exist] test_app/public[write] test_app/public/index.html[mkdir] test_app/templates[write] test_app/templates/exception.html.ep[write] test_app/templates/not_found.html.ep[mkdir] test_app/templates/layouts[write] test_app/templates/layouts/default.html.ep[mkdir] test_app/templates/example[write] test_app/templates/example/welcome.html.ep
18 декабря 2009 г.
![Page 196: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/196.jpg)
[exist] test_app/public[write] test_app/public/index.html[mkdir] test_app/templates[write] test_app/templates/exception.html.ep[write] test_app/templates/not_found.html.ep[mkdir] test_app/templates/layouts[write] test_app/templates/layouts/default.html.ep[mkdir] test_app/templates/example[write] test_app/templates/example/welcome.html.ep
18 декабря 2009 г.
![Page 197: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/197.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 198: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/198.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 199: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/199.jpg)
controller/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 200: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/200.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 201: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/201.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 202: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/202.jpg)
example/action.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 203: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/203.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 204: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/204.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 205: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/205.jpg)
example/welcome.html.handler
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 206: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/206.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 207: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/207.jpg)
example/welcome.html.epl
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 208: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/208.jpg)
example/welcome.html.tt
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 209: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/209.jpg)
example/welcome.html.ht
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 210: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/210.jpg)
example/welcome.html.pro
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 211: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/211.jpg)
example/welcome.html.ctpp2 Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 212: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/212.jpg)
example/welcome.html.foo
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 213: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/213.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 214: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/214.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 215: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/215.jpg)
example/welcome.format.ep Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 216: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/216.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 217: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/217.jpg)
example/welcome.xml.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 218: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/218.jpg)
example/welcome.rss.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 219: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/219.jpg)
example/welcome.json.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 220: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/220.jpg)
example/welcome.yaml.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 221: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/221.jpg)
example/welcome.mail.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 222: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/222.jpg)
example/welcome.bar.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 223: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/223.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 224: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/224.jpg)
example/welcome.html.ep
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 225: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/225.jpg)
controller/action.format.handler
Автоматическая генерация имени шаблона
18 декабря 2009 г.
![Page 226: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/226.jpg)
% layout 'default';
<h2><%= $message %></h2>
<a href="<%== url_for %>">click here</a>
18 декабря 2009 г.
![Page 227: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/227.jpg)
[exist] test_app/public[write] test_app/public/index.html[mkdir] test_app/templates[write] test_app/templates/exception.html.ep[write] test_app/templates/not_found.html.ep[mkdir] test_app/templates/layouts[write] test_app/templates/layouts/default.html.ep[mkdir] test_app/templates/example[write] test_app/templates/example/welcome.html.ep
18 декабря 2009 г.
![Page 228: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/228.jpg)
<!doctype html><html> <head><title>Welcome</title></head> <body> <%== content %> </body></html>
18 декабря 2009 г.
![Page 229: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/229.jpg)
[exist] test_app/public[write] test_app/public/index.html[mkdir] test_app/templates[write] test_app/templates/exception.html.ep[write] test_app/templates/not_found.html.ep[mkdir] test_app/templates/layouts[write] test_app/templates/layouts/default.html.ep[mkdir] test_app/templates/example[write] test_app/templates/example/welcome.html.ep
18 декабря 2009 г.
![Page 230: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/230.jpg)
Global symbol "$message2" requires explicit package name at (eval 280) line 2.
1: % layout 'default';2: <h2><%= $message2 %></h2>3: ...
{ 'status' => 500, 'message' => ‘Saint Perl 2009’, ... }
18 декабря 2009 г.
![Page 231: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/231.jpg)
$ENV{MOJO_MODE}По умолчанию development
18 декабря 2009 г.
![Page 232: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/232.jpg)
[exist] test_app/public[write] test_app/public/index.html[mkdir] test_app/templates[write] test_app/templates/exception.html.ep[write] test_app/templates/not_found.html.ep[mkdir] test_app/templates/layouts[write] test_app/templates/layouts/default.html.ep[mkdir] test_app/templates/example[write] test_app/templates/example/welcome.html.ep
18 декабря 2009 г.
![Page 233: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/233.jpg)
Mojolicious::Liteuse base 'Mojolicious';
18 декабря 2009 г.
![Page 234: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/234.jpg)
mojolicious generate lite_app test_lite
18 декабря 2009 г.
![Page 235: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/235.jpg)
[write] test_lite[chmod] test_lite 744
18 декабря 2009 г.
![Page 236: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/236.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 237: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/237.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 238: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/238.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 239: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/239.jpg)
use Mojolicious::Lite;
post '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 240: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/240.jpg)
use Mojolicious::Lite;
any '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 241: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/241.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 242: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/242.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => [groovy => qr/\d+/] => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 243: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/243.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => {groovy => 42} => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 244: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/244.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => (agent=>qr/Firefox/) => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 245: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/245.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};app->renderer->default_handler(‘epl’);shagadelic;
18 декабря 2009 г.
![Page 246: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/246.jpg)
use Mojolicious::Lite;ladder sub { ... }; # authget '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic;
18 декабря 2009 г.
![Page 247: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/247.jpg)
use Mojolicious::Lite;
get '/' => 'index';
any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy'));};
shagadelic; # shagadelic(‘cgi’)
18 декабря 2009 г.
![Page 248: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/248.jpg)
__DATA__
@@ index.html.ep% layout 'funky';Yea baby!
@@ layouts/funky.html.ep<!doctype html><html> <body> <%== content %> </body></html>
18 декабря 2009 г.
![Page 249: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/249.jpg)
Mojo-модули на CPAN
18 декабря 2009 г.
![Page 250: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/250.jpg)
Mojo-модули на CPAN• Mojo
• Mojo::Server::FCGI
• AnyEvent::Mojo
• Apache::Mojo, Apache2::Mojo
• Catalyst::Engine::Mojo,Squatting::On::Mojo
• MojoX::UserAgent
• MojoX::Routes::AsGraph
• MojoX::Session
• MojoX::Log::*
• MojoX::Renderer::*
• JSON
• TT
• CTTP2, HTP
18 декабря 2009 г.
![Page 251: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/251.jpg)
Mojo Guide StyleRules
18 декабря 2009 г.
![Page 252: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/252.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 253: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/253.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 254: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/254.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 255: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/255.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 256: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/256.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 257: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/257.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama
Mojo Guide Style
18 декабря 2009 г.
![Page 258: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/258.jpg)
• Keep it simple, no magick unless absolutely nessary
• Code should be written with a Perl6 port in mind
• It’s not a feature without a test
• Only add prereqs if absolutely necessary
• No inline POD
• No spaghetti code
• Every files should contain at least one quote fromThe Simpsons or Futurama :)
Mojo Guide Style
18 декабря 2009 г.
![Page 259: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/259.jpg)
The Simpsons or Futurama18 декабря 2009 г.
![Page 260: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/260.jpg)
Стабильная версия,обратная
совместимость?
18 декабря 2009 г.
![Page 261: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/261.jpg)
Mojo 0.999915Последняя версия всегда доступна на github.com
18 декабря 2009 г.
![Page 262: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/262.jpg)
http://github.com/kraih/mojo18 декабря 2009 г.
![Page 263: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/263.jpg)
Обратная совместимость не гарантируется :)До первой стабильной версии
18 декабря 2009 г.
![Page 264: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/264.jpg)
Первый критичный баг
18 декабря 2009 г.
![Page 265: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/265.jpg)
get ‘/bug/’ => sub { my $self = shift;
# open my $fh, ‘|-’, ‘/usr/sbin/sendmail -t’; open my $fh, ‘|-’, ‘perl test.pl’; print $fh join "\n", 'To: sharifulin at gmail.com', 'Subject: Test', '', 'Test!'; $self->render_text(‘Test’);;};
18 декабря 2009 г.
![Page 266: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/266.jpg)
get ‘/bug/’ => sub { my $self = shift;
# open my $fh, ‘|-’, ‘/usr/sbin/sendmail -t’; open my $fh, ‘|-’, ‘perl test.pl’; print $fh join "\n", 'To: sharifulin at gmail.com', 'Subject: Test', '', 'Test!'; $self->render_text(‘Test’);;};
18 декабря 2009 г.
![Page 267: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/267.jpg)
test.pl
#!/usr/bin/perlwarn $_ while <STDIN>;
18 декабря 2009 г.
![Page 268: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/268.jpg)
script/test_bug daemon # OK
18 декабря 2009 г.
![Page 269: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/269.jpg)
script/test_bug daemon # OKscript/test_bug daemon_prefork # DIE
18 декабря 2009 г.
![Page 270: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/270.jpg)
Mojo::Server::Daemon::Prefork #323:
$SIG{HUP } = $SIG{INT } = $SIG{CHLD} = $SIG{TERM} = sub { exit 0 };
18 декабря 2009 г.
![Page 271: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/271.jpg)
Mojo::Server::Daemon::Prefork #323:
$SIG{HUP } = $SIG{INT } = $SIG{CHLD} = $SIG{TERM} = sub { exit 0 };
18 декабря 2009 г.
![Page 272: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/272.jpg)
Mojo::Server::Daemon::Prefork #323:
$SIG{HUP } = $SIG{INT } = $SIG{TERM } = sub { exit 0 };
$SIG{CHLD} = ‘IGNORE’;
18 декабря 2009 г.
![Page 273: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/273.jpg)
Второй критичный баг
18 декабря 2009 г.
![Page 274: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/274.jpg)
Второй критичный мой баг
18 декабря 2009 г.
![Page 275: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/275.jpg)
MOJO_RELOAD, daemon и attr
18 декабря 2009 г.
![Page 276: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/276.jpg)
MOJO_RELOAD=1 script/test_bug2 daemon# OK
18 декабря 2009 г.
![Page 277: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/277.jpg)
MOJO_RELOAD=1 script/test_bug2 daemon# OK не всегда
18 декабря 2009 г.
![Page 278: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/278.jpg)
script/test_bug2 daemon_prefork # OK
18 декабря 2009 г.
![Page 279: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/279.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 280: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/280.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 281: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/281.jpg)
package App;use base ‘Mojo::Base’;
__PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’;});__PACKAGE__->attr(db => sub { my $self = shift; return $::DB ||= Util->db(...->{'db'});});
sub dispatch { ... }18 декабря 2009 г.
![Page 282: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/282.jpg)
Документация
18 декабря 2009 г.
![Page 283: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/283.jpg)
ДокументацияНе очень :)
18 декабря 2009 г.
![Page 284: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/284.jpg)
«мне кажется документацию он никогда не напишет) он х**рит быстрее, чем можно писать документацию для него)»
FriendFeed форева!
18 декабря 2009 г.
![Page 285: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/285.jpg)
Полезная информация
• http://mojolicious.org
• http://labs.kraih.com/blog/
• http://search.cpan.org/dist/Mojo/
• http://github.com/kraih/mojo
• http://sharifulin.livejournal.com/tag/mojo
• http://getbootylicious.org/
18 декабря 2009 г.
![Page 286: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/286.jpg)
Полезная информация
• http://mojolicious.org
• http://labs.kraih.com/blog/
• http://search.cpan.org/dist/Mojo/
• http://github.com/kraih/mojo
• http://sharifulin.livejournal.com/tag/mojo
• http://getbootylicious.org/
18 декабря 2009 г.
![Page 287: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/287.jpg)
Bootylicious18 декабря 2009 г.
![Page 288: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/288.jpg)
Bootylicious18 декабря 2009 г.
![Page 289: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/289.jpg)
«А жопа-то у неё ничего»18 декабря 2009 г.
![Page 290: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/290.jpg)
Полезная информация
• irc://irc.perl.org/#mojo
• http://lists.kraih.com/cgi-bin/mailman/listinfo/mojo
• Twitter: @kraih, @vtivti, @sharifulin
• Juick: @vti, @sharifulin
18 декабря 2009 г.
![Page 291: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/291.jpg)
Последние новости
• PSGI and Plack is the future of HTTP::Engine that has support for servers like CGI, FastCGI, Apache, AnyEvent and Mojo.
• New #mod_perlite release looks great, #Mojolicious with CGI backend should "just work™" on it.
• Slowly starting with documentation work, crazy how much #Mojolicious has grown recently, looks like it needs a few extra chapters now. :)
• Added native #PSGI support to #Mojolicious
18 декабря 2009 г.
![Page 292: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/292.jpg)
Опыт разработки на Mojo
18 декабря 2009 г.
![Page 293: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/293.jpg)
Mojolicious + MojoX::Renderer::TT18 декабря 2009 г.
![Page 294: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/294.jpg)
Mojo + JSON18 декабря 2009 г.
![Page 295: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/295.jpg)
Mojolicious::Lite + MojoX::Renderer::JSON
18 декабря 2009 г.
![Page 296: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/296.jpg)
Mojolicious::Lite + MojoX::Renderer::JSON + RSS
18 декабря 2009 г.
![Page 297: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/297.jpg)
Mojolicious + Mojo::Template18 декабря 2009 г.
![Page 298: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/298.jpg)
Mojolicious + EpRendererОколо 7 проектов работает
18 декабря 2009 г.
![Page 299: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/299.jpg)
«Я никогда так быстро не делал сайты на Perl»
Анатолий Шарифулин :)
18 декабря 2009 г.
![Page 300: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/300.jpg)
«Making hard things possible and everything fun!»Девиз Mojolicious
18 декабря 2009 г.
![Page 301: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/301.jpg)
«Можно ли на хостинге, где только FTP, Apache и CGI?»Постоянный вопрос, который задают мне
18 декабря 2009 г.
![Page 302: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/302.jpg)
Ответ: «Да!»
18 декабря 2009 г.
![Page 303: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/303.jpg)
Ответ: «Да!»Только я не проверял :)
18 декабря 2009 г.
![Page 304: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/304.jpg)
«Можно ли на Windows использовать Mojo?»
И еще один
18 декабря 2009 г.
![Page 305: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/305.jpg)
Ответ: «Да!»
18 декабря 2009 г.
![Page 306: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/306.jpg)
Ответ: «Да!»Только не я пробовал :)
18 декабря 2009 г.
![Page 307: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/307.jpg)
use Mojoor die
18 декабря 2009 г.
![Page 308: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/308.jpg)
use Perlor die
18 декабря 2009 г.
![Page 309: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/309.jpg)
JFDI
18 декабря 2009 г.
![Page 310: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/310.jpg)
any ‘/questions/’ => sub { shift->render( say => ‘sharifulin’, );};shagadelic;
18 декабря 2009 г.
![Page 311: Mojo. Веб в коробке!](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560fa1bd8b42a0e408b4d7a/html5/thumbnails/311.jpg)
Спасибо за внимание!Было 311 слайдовАнатолий Шарифулин
RostovOnDon.pm
18 декабря 2009 г.