|<<
<
>
>>|
/
{{img src="images/tv.png" width="1000" height="750"}} ---- Реклама! ---- 13-15 May YAPC::Russia {{#x|May Perl}} in Moscow ---- The 5th big russian Perl event ---- (4th in the status of full YAPC) ---- Completely free ---- {{www.perlrussia.org|http://perlrussia.org}} ---- 15-17 August {{#x|YAPC::Europe}} in Riga ---- {{img src="images/yapcriga.gif" width="250" height="250"}} ---- {{www.yapceurope.lv|http://yapceurope.lv}} ---- Our {{#x|THIRD}} attempt! ---- {{#bold|2009}}: Lisbon > Moscow {{#bold|2010}}: Pisa > Kiev {{#bold|2011}}: Frankfurt {{#x|<}} Riga ---- </РЕКЛАМА> ---- One-filers without dependencies {{#author|Алексей Капранов}} {{#author|Alex Kapranoff}} {{#date|2011, February}} ---- {{www.kapranoff.ru/onefilers|http://kapranoff.ru/onefilers}} ---- Perl is famous for one-liners ---- % perl -e ---- % perl -E ---- The shortest form of applications possible ---- The other end is big apps ---- % dancer -a SocialNetwork ---- + SocialNetwork + SocialNetwork/bin + SocialNetwork/bin/app.pl + SocialNetwork/config.yml + SocialNetwork/environments + SocialNetwork/environments/development.yml + SocialNetwork/environments/production.yml + SocialNetwork/views + SocialNetwork/views/index.tt ---- 31 files in total ---- Even further: apps spanning several computers or even several data centers ---- in the middle (closer to one-liners) are ---- one-filers ---- AKA scripts :) ---- everyone has them ---- especially sysadmins ---- and power users ---- parsers, converters, backup scripts, generators etc. ---- Used one time ---- Until they get really useful ---- end up in crontabs ---- and on different hosts ---- How to publish one-filers? ---- 1. Use CPAN — {{#x|App::}} namespace. ---- (not user-friendly) ---- 2. Use {{#x|PAR}} to make standalone executable. ---- (huge files and {{#x|PAR}} has bugs) ---- (but still {{#x|PAR}} is great, check it out!) ---- 3. Use {{#x|App::FatPacker}}. ---- (does not support XS modules, has bugs) ---- 4. Let the script download its dependencies! ---- This was my idea and here are my results so far ---- * We have {{#x|Module::ScanDeps}} ---- * We have wonderful {{#x|cpanminus}} ---- * We have {{#x|HTTP::Lite}} and {{#x|HTTP::Tiny}} ---- * We can include whole modules in BEGIN blocks ---- Plan: 1. include small HTTP client inside script 2. download {{#x|cpanminus}} 3. install all dependencies 4. profit! ---- {{#x|App::ThinPacker}} (not released yet) ---- % thinpack gdocs-backup.pl > gdocs-backup-dist.pl % ---- % ./gdocs-backup-dist.pl --> Working on Net::Google::DocumentsList Fetching http://search.cpan.org/CPAN/authors/id/D/DA/DANJOU/Net-Google-DocumentsList-0.05.tar.gz ... OK Configuring Net-Google-DocumentsList-0.05 ... OK ==> Found dependencies: Net::Google::DataAPI ... ---- Current issues: ---- 1. Only Unix/Linux ---- 2. Small embedded HTTP client is not small :) ---- 3. Scripts require manual fixes sometimes ---- 4. Error recovery is not working ---- {{www.kapranoff.ru/onefilers|http://kapranoff.ru/onefilers}} ---- {{github.com/kappa|http://github.com/kappa}} ---- Мерси And now I have to run to the airport, so no questions this time :) © Алексей Капранов, 2011, http://search.cpan.org/~kappa/ http://friendfeed.com/kkapp for Perl Bulgaria 2011, perlbulgaria2011 This is for nothing if we don't go to the stars. æ