SlideShare a Scribd company logo
1 of 27
Author: Mons Anderson (MONS)
search.cpan.org/~mons XML-Declare uni-perl AnyEvent-SMTP accessors-fast ex-lib Test-If AnyEvent-RPC Acme-CPANAuthors-AnyEvent constant-def AnyEvent-Worker Image-JpegTran XML-Hash-LX Socket-AcceptFilter XML-Parser-Style-EasyTree lvalue Catalyst-Action-Serialize-XML-Hash-LX XML-Fast Devel-Leak-Cb lib-abs Crypt-RSA-Yandex AnyEvent-Connection AnyEvent-Memcached Test-More-UTF8 Dash-Leak AnyEvent-Handle-Writer Variable-Eject self-init XML-RPC-Fast Image-LibExif Test-Dist
github.com/Mons AnyEvent::HTTP::Server AnyEvent::UA AnyEvent-XMPP-2 Proc::Vsize Daemond Devel::Rewrite CatalystX-InternalRedirect
use lib ? use lib '../lib'; use lib '/opt/project/lib'; use FindBin; use lib «$FindBin::Bin/../lib»;
09.11.2008 ex::lib (now lib::abs) (thanks to A. Shrub ;)
use lib::abs (ex::lib) use lib::abs '../lib'; use lib::abs '../../*/lib';
use, use, use? use utf8; use strict; use warnings; use Carp; use Data::Dumper; use open qw(:utf8 :std); use mro 'c3'; use feature qw(say state switch);
use warnings? Use of uninitialized value...
common::sense? - No utf8 until v3.0 - No open :utf8 support for v3.0+ - No require perl 5.10+ for features - No Carp - No mro
use uni::perl ':dumper'; use strict; use feature qw(say state switch); no warnings; use warnings qw(FATAL ...); no warnings qw(exec newline); use utf8; use open (:utf8 :std); use mro 'c3'; use autouse 'Carp'; use autouse 'Data::Dumper';
Secret feature ;) (pluggable) use uni::perl ':ru'; say cp1251::encode «...»; say cp1251::decode «...»; say koi8r::encode «...»; say koi8r::decode «...»; say cp866::encode «...»; say cp866::decode «...»;
XML::* XML::RPC::Fast XML::Parser::Style::EasyTree XML::Hash::LX XML::Fast XML::Declare
Test::* Test::Dist kwalitee for cpants.perl.org
Test::* Test::If — tired of eval { use Test::...; 1 } or plan skip_all => «...»; $Test::...::VERSION >= 1.23 or plan skip_all => «...»;
Test::* Test::More::UTF8 against Wide character in print at Test/Builder.pm line 1698.
Fun syntax - lvalue - self::init - accessors-fast - constant-def
lvalue sub mysub : lvalue { get { return 'result for get'; } set { my $set_value = shift;   # ... } }
self::init use self::init a => qw(a b), b => (), c => qw( c c ), ; vs __PACKAGE__->a(qw(a b)); __PACKAGE__->b(); __PACKAGE__->c(qw(c c));
accessors::fast use accessors::fast qw(field1 field2); vs use base 'Class::Accessors::Fast'; __PACKAGE__->mk_accessors( qw(field1 field2) );
constant::def use constant::abs 'My::DEBUG' => 1; use constant::def DEBUG => 0; vs BEGIN { *My::DEBUG = sub () { 1 }; } BEGIN { defined &DEBUG or *DEBUG = sub () { 0 }; }
AnyEvent::* AnyEvent::Connection manage your connection AnyEvent::SMTP send 7k emails/s AnyEvent::Memcached client with rget (for memcachedb) AnyEvent::Worker any blocking work for AE app AnyEvent::Handle::Writer use sendfile() with write queue AnyEvent::HTTP::Server pipeline, websockets, http/1.1 AnyEvent::UA http/1.1 useragent
Image::* Image::JpegTran (binding to jpegtran) Image::LibExif 4000% (40 times) faster than Image::ExifTool
Daemond (github) - Correct daemonization - Detach - redirection of output - keeping the fileno for STD* handles - chroot - change user - Pluggable engine - Built-in CLI (Command-line interface) - Pidfile - Scoreboard - Different packages for child and parent - Child monitoring for parent death - Timers for termination
Simple Daemond  package SampleD; use Daemond -parent; name 'test'; cli;  # Command line control proc;  # Alter $0 children 1; # How many children pid '/var/run/test.pid'; child { $SIG{USR2} = sub { exit; }; while() { do_job(); } };
Daemond CLI Usage: [options] [start|stop|restart|check] Options: -v, --verbose increase verbosity level -f, --nodetach run in nodetach mode -c N, --children N redefine count of children
Devel::Rewrite # @rewrite s/^#+//; # use Some::Development::Module; # @rewrite s/some_call/another_call/; $object->some_call; sub something { # @include sub.debug.inc ... } perl -MDevel::Rewrite …
Dash-Leak use Dash::Leak; { leaksz "block label"; # some code, that may leak } leaksz "tests begin"; some_operation($arg); leaksz "some_operation", sub { warn sprintf "We leaked by %+d kilobytes;", shift }; $ DEBUG_MEM=1 perl ...

More Related Content

What's hot

Application Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.keyApplication Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.keyTim Bunce
 
Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0Binary Studio
 
Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting Sergey Volkodav
 
Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Cloudflare
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queueBrandon Lamb
 
Top 10 Perl Performance Tips
Top 10 Perl Performance TipsTop 10 Perl Performance Tips
Top 10 Perl Performance TipsPerrin Harkins
 
[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuitNAVER D2
 
CPAN 模組二三事
CPAN 模組二三事CPAN 模組二三事
CPAN 模組二三事Lin Yo-An
 
Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012Dan Kuebrich
 
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxGo debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxSignalFx
 
Profiling with Devel::NYTProf
Profiling with Devel::NYTProfProfiling with Devel::NYTProf
Profiling with Devel::NYTProfbobcatfish
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopSaša Tatar
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?Docker, Inc.
 
Perl Memory Use 201209
Perl Memory Use 201209Perl Memory Use 201209
Perl Memory Use 201209Tim Bunce
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...Vadym Kazulkin
 
Streams are Awesome - (Node.js) TimesOpen Sep 2012
Streams are Awesome - (Node.js) TimesOpen Sep 2012 Streams are Awesome - (Node.js) TimesOpen Sep 2012
Streams are Awesome - (Node.js) TimesOpen Sep 2012 Tom Croucher
 
CQL: SQL In Cassandra
CQL: SQL In CassandraCQL: SQL In Cassandra
CQL: SQL In CassandraEric Evans
 

What's hot (20)

Application Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.keyApplication Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.key
 
Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0
 
Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting
 
Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
Top 10 Perl Performance Tips
Top 10 Perl Performance TipsTop 10 Perl Performance Tips
Top 10 Perl Performance Tips
 
[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit
 
CPAN 模組二三事
CPAN 模組二三事CPAN 模組二三事
CPAN 模組二三事
 
Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012
 
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxGo debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFx
 
RabbitMQ for Perl mongers
RabbitMQ for Perl mongersRabbitMQ for Perl mongers
RabbitMQ for Perl mongers
 
Profiling with Devel::NYTProf
Profiling with Devel::NYTProfProfiling with Devel::NYTProf
Profiling with Devel::NYTProf
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loop
 
2017 meetup-apache-kafka-nov
2017 meetup-apache-kafka-nov2017 meetup-apache-kafka-nov
2017 meetup-apache-kafka-nov
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?
 
Perl Memory Use 201209
Perl Memory Use 201209Perl Memory Use 201209
Perl Memory Use 201209
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
 
Streams are Awesome - (Node.js) TimesOpen Sep 2012
Streams are Awesome - (Node.js) TimesOpen Sep 2012 Streams are Awesome - (Node.js) TimesOpen Sep 2012
Streams are Awesome - (Node.js) TimesOpen Sep 2012
 
Go memory
Go memoryGo memory
Go memory
 
CQL: SQL In Cassandra
CQL: SQL In CassandraCQL: SQL In Cassandra
CQL: SQL In Cassandra
 

Viewers also liked

Guitar Hero, Wikipedia, VK, Perl, Like it!
Guitar Hero, Wikipedia, VK, Perl, Like it!Guitar Hero, Wikipedia, VK, Perl, Like it!
Guitar Hero, Wikipedia, VK, Perl, Like it!Anatoly Sharifulin
 
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....Moscow.pm
 
Введение в веб-технологии. Лекция.
Введение в веб-технологии. Лекция. Введение в веб-технологии. Лекция.
Введение в веб-технологии. Лекция. Rauf Aliev
 
Buytaert kris tools
Buytaert kris toolsBuytaert kris tools
Buytaert kris toolskuchinskaya
 
Развитие интернета в регионах России
Развитие интернета в регионах РоссииРазвитие интернета в регионах России
Развитие интернета в регионах РоссииMedia Gorod
 
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...Moscow.pm
 
Communication Online
Communication OnlineCommunication Online
Communication Onlinekraemera
 

Viewers also liked (9)

Guitar Hero, Wikipedia, VK, Perl, Like it!
Guitar Hero, Wikipedia, VK, Perl, Like it!Guitar Hero, Wikipedia, VK, Perl, Like it!
Guitar Hero, Wikipedia, VK, Perl, Like it!
 
Hexlet Deck
Hexlet DeckHexlet Deck
Hexlet Deck
 
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....
Разработка документации для RESTful API: как убить трёх зайцев одним. Moscow....
 
Ae internals
Ae internalsAe internals
Ae internals
 
Введение в веб-технологии. Лекция.
Введение в веб-технологии. Лекция. Введение в веб-технологии. Лекция.
Введение в веб-технологии. Лекция.
 
Buytaert kris tools
Buytaert kris toolsBuytaert kris tools
Buytaert kris tools
 
Развитие интернета в регионах России
Развитие интернета в регионах РоссииРазвитие интернета в регионах России
Развитие интернета в регионах России
 
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...
Ленивые итераторы для разбора разнородных данных. Михаил Озеров. Moscow.pm 6 ...
 
Communication Online
Communication OnlineCommunication Online
Communication Online
 

Similar to Владимир Перепелица "Модули"

Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in RustInfluxData
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
How CPAN Testers helped me improve my module
How CPAN Testers helped me improve my moduleHow CPAN Testers helped me improve my module
How CPAN Testers helped me improve my moduleacme
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environmentEvaldo Felipe
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_mapslcplcp1
 
Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1상욱 송
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018Fabio Janiszevski
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commandsRishu Seth
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Ilya Haykinson
 
Painless Perl Ports with cpan2port
Painless Perl Ports with cpan2portPainless Perl Ports with cpan2port
Painless Perl Ports with cpan2portBenny Siegert
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Sylvain Wallez
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With YouDalibor Gogic
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomValeriy Kravchuk
 

Similar to Владимир Перепелица "Модули" (20)

Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Jaap : node, npm & grunt
Jaap : node, npm & gruntJaap : node, npm & grunt
Jaap : node, npm & grunt
 
How CPAN Testers helped me improve my module
How CPAN Testers helped me improve my moduleHow CPAN Testers helped me improve my module
How CPAN Testers helped me improve my module
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environment
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
 
Logstash
LogstashLogstash
Logstash
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
Puppet
PuppetPuppet
Puppet
 
Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4
 
Painless Perl Ports with cpan2port
Painless Perl Ports with cpan2portPainless Perl Ports with cpan2port
Painless Perl Ports with cpan2port
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
 

More from Media Gorod

Iidf market watch_2013
Iidf market watch_2013Iidf market watch_2013
Iidf market watch_2013Media Gorod
 
E travel 2013 ufs-f
E travel 2013 ufs-fE travel 2013 ufs-f
E travel 2013 ufs-fMedia Gorod
 
Travel shop 2013
Travel shop 2013Travel shop 2013
Travel shop 2013Media Gorod
 
Kozyakov pay u_e-travel2013
Kozyakov pay u_e-travel2013Kozyakov pay u_e-travel2013
Kozyakov pay u_e-travel2013Media Gorod
 
13909772985295c7a772abc7.11863824
13909772985295c7a772abc7.1186382413909772985295c7a772abc7.11863824
13909772985295c7a772abc7.11863824Media Gorod
 
As e-travel 2013
As   e-travel 2013As   e-travel 2013
As e-travel 2013Media Gorod
 
Ishounkina internet research-projects
Ishounkina internet research-projectsIshounkina internet research-projects
Ishounkina internet research-projectsMedia Gorod
 
Orlova pay u group_290813_
Orlova pay u group_290813_Orlova pay u group_290813_
Orlova pay u group_290813_Media Gorod
 
Ep presentation (infographic 2013)
Ep presentation (infographic 2013)Ep presentation (infographic 2013)
Ep presentation (infographic 2013)Media Gorod
 
Iway slides e-travel_2013-11_ready
Iway slides e-travel_2013-11_readyIway slides e-travel_2013-11_ready
Iway slides e-travel_2013-11_readyMedia Gorod
 
Data insight e-travel2013
Data insight e-travel2013Data insight e-travel2013
Data insight e-travel2013Media Gorod
 
Электронное Правительство как Продукт
Электронное Правительство как ПродуктЭлектронное Правительство как Продукт
Электронное Правительство как ПродуктMedia Gorod
 
Lean мышление / Специфика Lean Startup
Lean мышление / Специфика Lean StartupLean мышление / Специфика Lean Startup
Lean мышление / Специфика Lean StartupMedia Gorod
 
Глобальный взгляд на мобильный мир (Nielsen)
 Глобальный взгляд на мобильный мир (Nielsen) Глобальный взгляд на мобильный мир (Nielsen)
Глобальный взгляд на мобильный мир (Nielsen)Media Gorod
 
Как россияне используют смартфоны (Nielsen)
 Как россияне используют смартфоны (Nielsen) Как россияне используют смартфоны (Nielsen)
Как россияне используют смартфоны (Nielsen)Media Gorod
 
Мобильный интернет в России (MailRuGroup)
Мобильный интернет в России (MailRuGroup) Мобильный интернет в России (MailRuGroup)
Мобильный интернет в России (MailRuGroup) Media Gorod
 

More from Media Gorod (20)

Itogi2013
Itogi2013Itogi2013
Itogi2013
 
Moneytree rus 1
Moneytree rus 1Moneytree rus 1
Moneytree rus 1
 
Iidf market watch_2013
Iidf market watch_2013Iidf market watch_2013
Iidf market watch_2013
 
E travel 2013 ufs-f
E travel 2013 ufs-fE travel 2013 ufs-f
E travel 2013 ufs-f
 
Travel shop 2013
Travel shop 2013Travel shop 2013
Travel shop 2013
 
Kozyakov pay u_e-travel2013
Kozyakov pay u_e-travel2013Kozyakov pay u_e-travel2013
Kozyakov pay u_e-travel2013
 
13909772985295c7a772abc7.11863824
13909772985295c7a772abc7.1186382413909772985295c7a772abc7.11863824
13909772985295c7a772abc7.11863824
 
As e-travel 2013
As   e-travel 2013As   e-travel 2013
As e-travel 2013
 
Ishounkina internet research-projects
Ishounkina internet research-projectsIshounkina internet research-projects
Ishounkina internet research-projects
 
E travel13
E travel13E travel13
E travel13
 
Orlova pay u group_290813_
Orlova pay u group_290813_Orlova pay u group_290813_
Orlova pay u group_290813_
 
Ep presentation (infographic 2013)
Ep presentation (infographic 2013)Ep presentation (infographic 2013)
Ep presentation (infographic 2013)
 
Iway slides e-travel_2013-11_ready
Iway slides e-travel_2013-11_readyIway slides e-travel_2013-11_ready
Iway slides e-travel_2013-11_ready
 
Data insight e-travel2013
Data insight e-travel2013Data insight e-travel2013
Data insight e-travel2013
 
Электронное Правительство как Продукт
Электронное Правительство как ПродуктЭлектронное Правительство как Продукт
Электронное Правительство как Продукт
 
Lean мышление / Специфика Lean Startup
Lean мышление / Специфика Lean StartupLean мышление / Специфика Lean Startup
Lean мышление / Специфика Lean Startup
 
Глобальный взгляд на мобильный мир (Nielsen)
 Глобальный взгляд на мобильный мир (Nielsen) Глобальный взгляд на мобильный мир (Nielsen)
Глобальный взгляд на мобильный мир (Nielsen)
 
Как россияне используют смартфоны (Nielsen)
 Как россияне используют смартфоны (Nielsen) Как россияне используют смартфоны (Nielsen)
Как россияне используют смартфоны (Nielsen)
 
Мобильный интернет в России (MailRuGroup)
Мобильный интернет в России (MailRuGroup) Мобильный интернет в России (MailRuGroup)
Мобильный интернет в России (MailRuGroup)
 
Meta Mass Media
Meta Mass MediaMeta Mass Media
Meta Mass Media
 

Владимир Перепелица "Модули"

  • 2. search.cpan.org/~mons XML-Declare uni-perl AnyEvent-SMTP accessors-fast ex-lib Test-If AnyEvent-RPC Acme-CPANAuthors-AnyEvent constant-def AnyEvent-Worker Image-JpegTran XML-Hash-LX Socket-AcceptFilter XML-Parser-Style-EasyTree lvalue Catalyst-Action-Serialize-XML-Hash-LX XML-Fast Devel-Leak-Cb lib-abs Crypt-RSA-Yandex AnyEvent-Connection AnyEvent-Memcached Test-More-UTF8 Dash-Leak AnyEvent-Handle-Writer Variable-Eject self-init XML-RPC-Fast Image-LibExif Test-Dist
  • 3. github.com/Mons AnyEvent::HTTP::Server AnyEvent::UA AnyEvent-XMPP-2 Proc::Vsize Daemond Devel::Rewrite CatalystX-InternalRedirect
  • 4. use lib ? use lib '../lib'; use lib '/opt/project/lib'; use FindBin; use lib «$FindBin::Bin/../lib»;
  • 5. 09.11.2008 ex::lib (now lib::abs) (thanks to A. Shrub ;)
  • 6. use lib::abs (ex::lib) use lib::abs '../lib'; use lib::abs '../../*/lib';
  • 7. use, use, use? use utf8; use strict; use warnings; use Carp; use Data::Dumper; use open qw(:utf8 :std); use mro 'c3'; use feature qw(say state switch);
  • 8. use warnings? Use of uninitialized value...
  • 9. common::sense? - No utf8 until v3.0 - No open :utf8 support for v3.0+ - No require perl 5.10+ for features - No Carp - No mro
  • 10. use uni::perl ':dumper'; use strict; use feature qw(say state switch); no warnings; use warnings qw(FATAL ...); no warnings qw(exec newline); use utf8; use open (:utf8 :std); use mro 'c3'; use autouse 'Carp'; use autouse 'Data::Dumper';
  • 11. Secret feature ;) (pluggable) use uni::perl ':ru'; say cp1251::encode «...»; say cp1251::decode «...»; say koi8r::encode «...»; say koi8r::decode «...»; say cp866::encode «...»; say cp866::decode «...»;
  • 12. XML::* XML::RPC::Fast XML::Parser::Style::EasyTree XML::Hash::LX XML::Fast XML::Declare
  • 13. Test::* Test::Dist kwalitee for cpants.perl.org
  • 14. Test::* Test::If — tired of eval { use Test::...; 1 } or plan skip_all => «...»; $Test::...::VERSION >= 1.23 or plan skip_all => «...»;
  • 15. Test::* Test::More::UTF8 against Wide character in print at Test/Builder.pm line 1698.
  • 16. Fun syntax - lvalue - self::init - accessors-fast - constant-def
  • 17. lvalue sub mysub : lvalue { get { return 'result for get'; } set { my $set_value = shift; # ... } }
  • 18. self::init use self::init a => qw(a b), b => (), c => qw( c c ), ; vs __PACKAGE__->a(qw(a b)); __PACKAGE__->b(); __PACKAGE__->c(qw(c c));
  • 19. accessors::fast use accessors::fast qw(field1 field2); vs use base 'Class::Accessors::Fast'; __PACKAGE__->mk_accessors( qw(field1 field2) );
  • 20. constant::def use constant::abs 'My::DEBUG' => 1; use constant::def DEBUG => 0; vs BEGIN { *My::DEBUG = sub () { 1 }; } BEGIN { defined &DEBUG or *DEBUG = sub () { 0 }; }
  • 21. AnyEvent::* AnyEvent::Connection manage your connection AnyEvent::SMTP send 7k emails/s AnyEvent::Memcached client with rget (for memcachedb) AnyEvent::Worker any blocking work for AE app AnyEvent::Handle::Writer use sendfile() with write queue AnyEvent::HTTP::Server pipeline, websockets, http/1.1 AnyEvent::UA http/1.1 useragent
  • 22. Image::* Image::JpegTran (binding to jpegtran) Image::LibExif 4000% (40 times) faster than Image::ExifTool
  • 23. Daemond (github) - Correct daemonization - Detach - redirection of output - keeping the fileno for STD* handles - chroot - change user - Pluggable engine - Built-in CLI (Command-line interface) - Pidfile - Scoreboard - Different packages for child and parent - Child monitoring for parent death - Timers for termination
  • 24. Simple Daemond package SampleD; use Daemond -parent; name 'test'; cli; # Command line control proc; # Alter $0 children 1; # How many children pid '/var/run/test.pid'; child { $SIG{USR2} = sub { exit; }; while() { do_job(); } };
  • 25. Daemond CLI Usage: [options] [start|stop|restart|check] Options: -v, --verbose increase verbosity level -f, --nodetach run in nodetach mode -c N, --children N redefine count of children
  • 26. Devel::Rewrite # @rewrite s/^#+//; # use Some::Development::Module; # @rewrite s/some_call/another_call/; $object->some_call; sub something { # @include sub.debug.inc ... } perl -MDevel::Rewrite …
  • 27. Dash-Leak use Dash::Leak; { leaksz "block label"; # some code, that may leak } leaksz "tests begin"; some_operation($arg); leaksz "some_operation", sub { warn sprintf "We leaked by %+d kilobytes;", shift }; $ DEBUG_MEM=1 perl ...