Perl as a Foreign Language

by @dankogai

It's good to be home

  →  

the-truth-of-gunma13

map { lang $_ } @puellae;

map { lang $_ } @puellae;

map { lang $_ } @puellae;

Perl, explained

tc1.search.naver.jp Then
use strict;
use warnings;
Now
use v5.12; # or better

Perl, reality?

tc1.search.naver.jp

JavaScript über alles!

Then
Perl runs everywhere
Now
JS runs everywhere

JavaScript über alles

「だがJavaScriptとともに生きることは出来る」

tokuhirom
"JavaScript is a language that everyone writes - reluctantly"

JavaScript über alles?

Then
Perl runs everywhere
Now
Perl runs everywhere

Unexpectedly Perl

ipod.com/init
#!  /usr/bin/perl
#  version 1.1
# if the host+path are in matrix then the redirect is to a single location
# if just the host is in matrix then the redirect is to host+the request uri
# nwk-productred  17.149.160.28 & 17.172.224.28
#
# to distibute this file us /usr/local/scr/distfilex
#
#
#$matrix{"http_host"} = "desturl";
$matrix{"stage-wscar.apple.com:8414"} = "http://stage-wscar.apple.com/cgi-bin/httptest";
#$matrix{"itutest.apple.com:8414"} = "http://stage-wscar.apple.com/cgi-bin/httptest";
# $matrix{""} = "";
#       my plan is to get these first.
$matrix{"imac.com"} = "http://www.apple.com/imac/?cid=oas-us-domains-imac.com";
$matrix{"macbookair.com"} = "http://www.apple.com/macbookair/?cid=oas-us-domains-macbookair.com";
$matrix{"speech.apple.com"} = "http://www.apple.com/macosx/";
#…
1;

Web Programming ist nicht alles!

asin:4873113687

Who said perl is slow?

use Benchmark qw/:all/;
cmpthese timethese 100,
  {
    node   => sub { `node cheat.js` },
    perl   => sub { `perl cheat.pl` },
    php    => sub { `php cheat.php` },
    python => sub { `python cheat.py` },
    ruby   => sub { `ruby cheat.rb` },
  };

Who said perl is slow?

         Rate    php   node python   ruby   perl
php    19.4/s     --    -3%   -42%   -91%   -93%
node   20.0/s     3%     --   -40%   -90%   -93%
python 33.7/s    74%    68%     --   -84%   -88%
ruby    208/s   975%   940%   519%     --   -27%
perl    286/s  1374%  1326%   749%    37%     --

Who said perl is slow?

% cat cheat.*
console.log(496165411);
496165411
print 496165411, "\n";
print(496165411)
puts 496165411

提供

True TDD

perl Makefile.PL
make
make test
make install
cpan, cpanplus, even cpanminus

True TDD

Decent Unicode Support

use v5.12;
use utf8;
binmode STDOUT => ':utf8';
my $s = "🐍";
say $s;
say sprintf "%04X", ord $s;
say length $s;
var s = "🐍";
print(s);
print(s.charCodeAt(0).toString(16));
print(s.length);

Perl as a community

220px-Larry_Wall_YAPC_2007 "No language is an island"
「島言語なんて、あるわけない」

No language is an island

asin:0596000278

There's more than one way to do it

Thank->you

$_->answer for @questions;