SlideShare a Scribd company logo
1 of 67
2016 年の Perl
(Long version)
Kenichi Ishigaki
@charsbar
YAPC::Hokkaido 2016
Dec 10, 2016
Perl 5 in 2016
Perl 5.24 was
releasedSome of the notable changes:
• Hashbang redirection to Perl 6
• autoderef was gone, postderef in
• Unicode 8.0 support
• Lexical $_ has been removed
• /C/ character class has been removed
• Nested declarations are not disallowed
• chdir('') no longer chdirs home
• sysread()/syswrite() and :utf8 handles
• Performance enhancements
• Several security fixes
Good old hashbang redirection
$ cat > hello.sh
#!/bin/sh
echo "Hello, World";
$ perl hello.sh
Hello, World
$ cat > hello.pl
#!/usr/bin/env perl -w
print "Hello, Worldn";
$ perl hello.pl
Hello, World
New hashbang
redirection to Perl 6
$ cat > hello.p6
#!/home/ishigaki/.rakudobrew/bin/perl6
use v6;
say "Hello, World";
$ perl5200 hello.p6
Perl v6.0.0 required--this is only v5.20.0, stopped at hello.p6 line 2.
BEGIN failed--compilation aborted at hello.p6 line 2.
$ perl5240 hello.p6
Hello, World
auto-dereferencing
• push $arrayref //= [], $scalar;
• for (keys $hashref) { ... }
• introduced in 5.14
• experimental since 5.18
auto-dereferencing is gone
× push $blessed_arrayref, $scalar;
× for (keys $blessed_hashref) { ... }
× print "interpolates $arrayref";
• push $arrayref->@*, $scalar;
• push $blessed_arrayref->@*, $scalar;
• print "interpolates $arrayref->@*";
• experimental since 5.20
postderef is no longer
experimental
postderef is no longer
experimental
△ $undef->%* # warning
× $maybe_undef->%* // {}
○ ($maybe_undef // {})->%*
× keys ($maybe_hashref // {})->%*
○ keys (($maybe_hashref // {})->%*)
○ keys %{$maybe_hashref // {}} # shorter...
Unicode 8.0
plackup -MEncode -e 'use 5.024; sub {[
200,
["Content-Type" => "text/plain"],
[encode_utf8("N{TACO} N{POPCORN}")],
]}'
Unicode 8.0:
Emoji Modifier
plackup -MEncode -e 'use 5.024; sub {[
200,
["Content-Type" => "text/plain"],
[encode_utf8(
"N{WOMAN}" .
"N{EMOJI MODIFIER FITZPATRICK TYPE-5}" .
" " .
"N{MAN}"
)],
]}'
Lexical $_ has
been removed
• for my $_ (...) { ... }
• implicitly used in given/when ( ~ 5.16)
• has been experimental since 5.18.
• See perl5180delta for details
/C/ character class
has been removed
my $c = "N{U+3042}"; # あ
say unpack "H*", $c; # e38182
$c =~ /(.)/; say sprintf "%x", $1; # 3042
$c =~ /(C)/; say sprintf "%x", $1; # e3
$c =~ s/(CC)C/$1x84/; say $c; # い
• deprecated since 5.20
Nested declarations
are not disallowed
my ($x, my($y)); # croaks now
our (my $x); # ditto
chdir(undef) no longer
chdirs home
chdir(undef) or die "since 5.24";
# but with no warning
sysread()/syswrite() are
deprecated on :utf8 handles
use strict;
use warnings;
open my $fh, '<:encoding(cp932)', 'test.txt';
# works as you expect
read($fh, my $buf, 3);
# doesn't respect the encoding; now warns
sysread($fh, my $buf, 3);
Performance
enchancements
• The overhead of scope entry/exit is
considerably reduced
(subroutine calls, loops, and basic blocks
become all faster)
• /fixed-string/ become much faster (in many
cases)
• arithmetic become faster
Security fixes
• Perl 5.22 set a wrong umask before calling
mkstemp(3)
• Out of boundary access in Win32 path
handling (since 5.005)
• File::Spec::canonpath lost taint (since 5.20:
PathTools-3.47)
• Avoid accessing uninitialized memory in
win32 crypt()
• On duplicate environment variables from
environ[]
See perldelta
(perl5240delta)
for other changes
Some of the coming
features/changes
(Perl 5.26)
• Unescaped literal { in regexp is not allowed (5.25.1)
• Lexical subroutines are no longer experimental
(5.25.2)
• ${^ENCODING} has been removed (5.25.3)
• Unicode 9.0 support (5.25.3)
• Indented Here-documents (5.25.7)
• Build option to exclude . in @INC (5.25.7)
Unescaped literal
{ in regexp
$foo =~ /d{1,10}/; # ok
$foo =~ /d{1}/; # ok
$foo =~ /something{}/; # now dies
$foo =~ /something{/; # now dies
$foo =~ /something[{]/; # ok
$foo =~ /something{/; # ok
$foo =~ /{}/; # still ok
• deprecated since 5.16
Lexical subroutines are
no longer experimental
{
sub whatever {
my $x = shift;
my sub inner {
... do something with $x ...
}
inner();
}
}
perldoc perlsyn for details
• experimental since 5.18
${^ENCODING} has
been removed
× use encoding 'cp932';
○ use encoding 'cp932', Filter => 1;
Good old Here-documents
{
my ($key, $value) = qw/foo bar/;
my $json_template = << "END";
{"$key": "$value"}
END
}
Indented Here-documents
{
my ($key, $value) = qw/foo bar/;
my $json_template = <<~ "END";
{"$key": "$value"}
END
}
Build option to
exclude . in @INC
$ plenv install 5.25.7 -Ddefault_inc_excludes_dot
• Beware if you use inc::Module::Install, t:: for testing
libraries, do "localfile.pl" for configuration, etc.
• This issue would probably be mitigated somehow (by
toolchainers).
• Your system perl may have been built with the same
option for security reasons.
• FindBin is always your friend.
See perl525[1-9]delta
for other changes
Changes in the
Community
• Karen Pauley stepped down as TPF President
• Perl 5 Pumpking: Ricardo Signes to Sawyer X
• YAPC to The Perl Conferences
2017.06.18-23 (Alexandria, Virginia, USA)
2017.08.09-11 (Amsterdam, Netherlands)
Other Perl Events
happened in 2016
• Various Perl Workshops
(Dutch, German, French, Alpine, Barcelona,
London, DC-Baltimore, etc)
• QA Hackathon in Rugby
• meta::hack
• Perl Dancer Conference 2016
CPAN Status
• 12915 PAUSE IDs (JP: 601)
• 34607 Distributions
As of Dec 10, 2016
CPAN Status
As of Dec 10, 2016
Number of releases
Year Worldwide Japanese
2012 22647 1858
2013 25760 3225
2014 27269 1937
2015 22999 1108
2016 18898 731
CPAN Status
As of Dec 10, 2016
Number of released distributions
Year Worldwide Japanese
2012 6777 539
2013 7442 804
2014 7586 566
2015 6823 407
2016 5957 306
CPAN Status
As of Dec 10, 2016
Number of new distributions
Year Worldwide Japanese
2012 2947 (of 6777;43%) 248 (of 539;46%)
2013 2836 (of 7442;38%) 420 (of 804;52%)
2014 2805 (of 7586;37%) 220 (of 566;39%)
2015 2249 (of 6823;33%) 123 (of 407;30%)
2016 2072 (of 5957;35%) 77 (of 306;25%)
CPAN Status
As of Dec 10, 2016
Number of authors who released
Year Worldwide Japanese
2012 1758 123
2013 1803 150
2014 1716 130
2015 1553 115
2016 1371 95
CPAN Status
As of Dec 10, 2016
Number of authors who released something new
Year Worldwide Japanese
2012 1047 (of 1758;60%) 78 (of 123;63%)
2013 1012 (of 1803;56%) 113 (of 150;75%)
2014 898 (of 1716;52%) 78 (of 130;60%)
2015 734 (of 1553;47%) 66 (of 115;57%)
2016 608 (of 1371;44%) 38 (of 95;40%)
CPAN Status
App:: (375), Locale::CLDR::Locales:: (196),
Net:: (195), Dist::Zilla::Plugin:: (141),
Test:: (129), Bencher:: (119), Acme:: (117),
Mojolicious::Plugin:: (104), Data:: (104),
WWW:: (101), Text:: (77), WebService:: (68),
Dancer2:: (67), Alien:: (64), HTML:: (64),
DBIx:: (60), Math:: (60), File:: (59), Log::
(59)...
Notable namespaces updated in 2016
CPAN Status
Char:: (35), App:: (14), Test:: (13),
Plack::Middleware:: (12), Acme:: (10),
Data:: (8), WebService:: (8), Redis (7),
HTML:: (7), Net:: (7), Mojolicious::Plugin:: (6),
DBIx:: (5), WWW:: (5), Text:: (5), Perl:: (4),
SQL::(4), Net::Azure:: (4), AnyEvent (4),
Dist:: (4)...
Ditto by Japanese
Perl 6 in 2016
THE Christmas
has come!
... as Larry announced last year.
Now we have the
Christmas ROAST
• Repository Of All Spec Tests
• "6.c" branch/tag in perl6/roast
• We also have Rakudo that doesn't die
by "use v6.c".
$ perl6 -v
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.
• say $*PERL.name; # Perl 6
• say $*PERL.version; # v6.c
• say $*PERL.compiler.name; # rakudo
• say $*PERL.compiler.version; # v2016.11
• say $*VM.name; # moar
• say $*VM.version; # v2016.11
Not everything is ready yet
"spectest" (made from roast) is fudged.
given $*DISTRO.name {
when "macosx" {
#?rakudo.jvm skip "file system events NYI? RT #124828"
subtest &macosx, "does watch-path work on Mac OS X";
}
default {
pass "Nothing reliable to test yet";
}
}
perl6/roast/S17-supply/watch-path.t
(for IO::Notification.watch-path)
However, Rakudo is
fairly STABLE now
... as long as you use the
tested features.
README for ROAST 6.c says:
Any tests that contain a "use
experimental" are not considered
part of the specification, and
their behavior is subject to
change. Anything not explicitly
tested here is experimental.
https://github.com/perl6/roast/blob/6.c/README#L8-L10
See the ROAST 6.c
when in doubt
• Design docs explain goals; not
the current status.
• 6.c-errata
Performance and
Reliability
Among others, Jonathan Worthington...
•completed his first 200-hours Perl 6 Performance and
Reliability Grant
•implemented heap snapshots in MoarVM
•improved lower-level (ie. largely MoarVM) performance
•fixed a number of memory leaks and concurrency bugs
•This Grant has been extended for another 200 hours.
http://news.perlfoundation.org/2016/08/perl-6-performance-and-
reliabi-1.html
According to a benchmark:
https://twitter.com/zoffix/status/796810512986238978
On other backends
Rakudo on JVM
• not included in Rakudo Star
distributions now
• much slower than Rakudo on
MoarVM but improving
Rakudo.js
• http://blogs.perl.org/users/pawel_murias/2016/10/update-on-
rakudojs.html
• http://blogs.perl.org/users/pawel_murias/2016/10/rakudojs-
update.html
• Work In Progress (P6 Grant)
• ECMAScript 6
Farewell to Parrot
• First Perl6 backend since 2001
• Related code was removed
from nqp
https://p6weekly.wordpress.com/2016/08/01/2016-31-an-end-of-
an-era/
Release Utilities
• Ticket Trakr
• IRC release bot
• http://blogs.perl.org/users/zoffix_znet/2016/08/i-botched-a-
perl-6-release-and-now-a-robot-is-taking-my-job.html
• https://github.com/rakudo/rakudo/blob/nom/docs/release_gu
ide_automated.md
TAP for Perl 6
• Tests in ROAST are written in
Perl 6, but p5 Test::Harness is
still used to run the tests.
• New TAP.pm6 has been
written to replace it.
https://p6weekly.wordpress.com/2016/08/22/2016-34-a-
quick-botch-from-cluj/
Some of the (coming)
features
Not only grammars and concurrency
but also...
• Unicode support, not just to
read/write
• TWEAK (equiv to BUILD of p5 Moose)
• lexical module loading
Unicode support
say 「こんにちはこんにちは」 ; # 半角「 」
のみ
my $ 税率 = 1.08; ($ 金額 ×$ 税率 ).say;
say 100² ÷ ⅕; # 50000;
say 100 ** 2 / unival("x[2155]");
TWEAK submethod
Consider you want to set "id"
automatically.
use v6.c;
class Foo {
has ($.x, $!id);
submethod BUILD() {
$!id = $!x * 2; # $!x is not set yet
}
method generated_id { $!id }
}
say Foo.new(x => 1).generated_id; # 0
TWEAK submethod
You can write like this, but...
use v6.c;
class Foo {
has ($.x, $!id);
submethod BUILD(:$!x) {
$!id = $!x * 2;
}
method generated_id { $!id }
}
say Foo.new(x => 1).generated_id; # 2
TWEAK submethod
use v6.c; # since 2016.11 (or v6.d when ready)
class Foo {
has ($.x, $!id);
submethod TWEAK() { # called after BUILDs
$!id = $!x * 2;
}
method generated_id { $!id }
}
say Foo.new(x => 1).generated_id; # 2
Lexical module load
not merged yet; this will break modules
that depend on old, Perl5-like behavior.
# A.pm6
class A {}
# B.pm6
use A;
class B {}
# test_lexical_module_load.pl6
use B;
A.new; # should die because A is not used here
Perl 6 Ecosystem
~750 modules as of 2016/12
https://modules.perl6.org/
Perl 6 Ecosystem
Don't worry: you can use numerous
Perl5 modules via Inline::Perl5.
use v6.c
use Inline::Perl5;
use DBI:from<Perl5>;
my $dbh = DBI.connect('dbi:Pg:database=test');
my $products = $dbh.selectall_arrayref(
'select * from products', {Slice => {}}
);
PSIXDISTS
Perl5 toolchain ignores distribution under
PAUSE_ID/Perl6/ directory.
http://cpan.metacpan.org/authors/id/P/PS/PSIXDISTS/Perl6/
Writing a Perl 6
module
$ panda install App::Mi6
$ mi6 new Your::Great::Module
Learning Perl 6
• Perl 6 Advent Calendars
https://perl6advent.wordpress.com/
See also tests under roast/integration/
http://qiita.com/advent-calendar/2016/perl6
http://qiita.com/advent-calendar/2015/perl6
• Perl 6 Introduction: http://ja.perl6intro.com
• RosettaCode
https://rosettacode.org/wiki/Category:Perl_6
• roast
• perl6.org
Perl 6 Books
Planned/In-Progress
• Learning Perl 6 (brian d foy)
https://www.kickstarter.com/projects/1422827986/learning-perl-6
• Perl 6 By Example (Moritz Lenz)
https://perlgeek.de/blog-en/perl-6/2016-book.html
Further Information
• Weekly changes in and around Perl 6
https://p6weekly.wordpress.com
• English videos about Perl 6 on YouTube
http://bit.ly/perl6_english_video
• WEB+DB PRESS Vol.93 「 Perl 6 の歩き
方」
http://gihyo.jp/dev/serial/01/perl-hackers-hub/003901
• About the next version (6.d)
https://github.com/perl6/specs/blob/master/v6d.pod
https://github.com/rakudo/rakudo/blob/nom/docs/language_
Thank you

More Related Content

What's hot

Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlHideaki Ohno
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012Tim Bunce
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
 
Perl Sucks - and what to do about it
Perl Sucks - and what to do about itPerl Sucks - and what to do about it
Perl Sucks - and what to do about it2shortplanks
 
The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5Wim Godden
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5Wim Godden
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and coPierre Joye
 
Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6trexy
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練Sheng-Hao Ma
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
Utility Modules That You Should Know About
Utility Modules That You Should Know AboutUtility Modules That You Should Know About
Utility Modules That You Should Know Aboutjoshua.mcadams
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationWorkhorse Computing
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPGuilherme Blanco
 

What's hot (20)

Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Perl Sucks - and what to do about it
Perl Sucks - and what to do about itPerl Sucks - and what to do about it
Perl Sucks - and what to do about it
 
The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and co
 
Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Utility Modules That You Should Know About
Utility Modules That You Should Know AboutUtility Modules That You Should Know About
Utility Modules That You Should Know About
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
 
Hachiojipm11
Hachiojipm11Hachiojipm11
Hachiojipm11
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
 

Viewers also liked

Json(::PP) is a-changing
Json(::PP) is a-changingJson(::PP) is a-changing
Json(::PP) is a-changingcharsbar
 
2017年夏のPerl
2017年夏のPerl2017年夏のPerl
2017年夏のPerlcharsbar
 
Mojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようMojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようcharsbar
 
CPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいCPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいcharsbar
 
JSON, JSON::PP, and more
JSON, JSON::PP, and moreJSON, JSON::PP, and more
JSON, JSON::PP, and morecharsbar
 
2017年春のPerl
2017年春のPerl2017年春のPerl
2017年春のPerlcharsbar
 

Viewers also liked (6)

Json(::PP) is a-changing
Json(::PP) is a-changingJson(::PP) is a-changing
Json(::PP) is a-changing
 
2017年夏のPerl
2017年夏のPerl2017年夏のPerl
2017年夏のPerl
 
Mojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようMojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみよう
 
CPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいCPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したい
 
JSON, JSON::PP, and more
JSON, JSON::PP, and moreJSON, JSON::PP, and more
JSON, JSON::PP, and more
 
2017年春のPerl
2017年春のPerl2017年春のPerl
2017年春のPerl
 

Similar to 2016年のPerl (Long version)

Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In PerlKang-min Liu
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principlesPerl Careers
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedBrendan Gregg
 
Php 5.6 From the Inside Out
Php 5.6 From the Inside OutPhp 5.6 From the Inside Out
Php 5.6 From the Inside OutFerenc Kovács
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
What's new in Perl 5.10?
What's new in Perl 5.10?What's new in Perl 5.10?
What's new in Perl 5.10?acme
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java DevelopersHostedbyConfluent
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perldaoswald
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest UpdatesIftekhar Eather
 
Ecmascript 2015 – best of new features()
Ecmascript 2015 – best of new features()Ecmascript 2015 – best of new features()
Ecmascript 2015 – best of new features()Miłosz Sobczak
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Gazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmGazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmMasahiro Nagano
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 
Getting by with just psql
Getting by with just psqlGetting by with just psql
Getting by with just psqlCorey Huinker
 
Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)Damien Seguy
 

Similar to 2016年のPerl (Long version) (20)

Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
Php 5.6 From the Inside Out
Php 5.6 From the Inside OutPhp 5.6 From the Inside Out
Php 5.6 From the Inside Out
 
Es6 hackathon
Es6 hackathonEs6 hackathon
Es6 hackathon
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
What's new in Perl 5.10?
What's new in Perl 5.10?What's new in Perl 5.10?
What's new in Perl 5.10?
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perl
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
 
Ecmascript 2015 – best of new features()
Ecmascript 2015 – best of new features()Ecmascript 2015 – best of new features()
Ecmascript 2015 – best of new features()
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Gazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmGazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapm
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScript
 
Getting by with just psql
Getting by with just psqlGetting by with just psql
Getting by with just psql
 
Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)
 

More from charsbar

Common boolean class_for_perl5
Common boolean class_for_perl5Common boolean class_for_perl5
Common boolean class_for_perl5charsbar
 
2018年夏のPerl5
2018年夏のPerl52018年夏のPerl5
2018年夏のPerl5charsbar
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁charsbar
 
perl language update
perl language updateperl language update
perl language updatecharsbar
 
2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情charsbar
 
Analyze CPAN, Analyze Community
Analyze CPAN, Analyze CommunityAnalyze CPAN, Analyze Community
Analyze CPAN, Analyze Communitycharsbar
 
Annual Report 2012
Annual Report 2012Annual Report 2012
Annual Report 2012charsbar
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLitecharsbar
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolscharsbar
 
CPANTS 2012
CPANTS 2012CPANTS 2012
CPANTS 2012charsbar
 
Revisiting ppm
Revisiting ppmRevisiting ppm
Revisiting ppmcharsbar
 
変数、リファレンス
変数、リファレンス変数、リファレンス
変数、リファレンスcharsbar
 
關於perl的 文件翻譯
關於perl的文件翻譯關於perl的文件翻譯
關於perl的 文件翻譯charsbar
 
Practical Bug Reporting
Practical Bug ReportingPractical Bug Reporting
Practical Bug Reportingcharsbar
 
Top Tens of 2008/2009
Top Tens of 2008/2009Top Tens of 2008/2009
Top Tens of 2008/2009charsbar
 

More from charsbar (15)

Common boolean class_for_perl5
Common boolean class_for_perl5Common boolean class_for_perl5
Common boolean class_for_perl5
 
2018年夏のPerl5
2018年夏のPerl52018年夏のPerl5
2018年夏のPerl5
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁
 
perl language update
perl language updateperl language update
perl language update
 
2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情
 
Analyze CPAN, Analyze Community
Analyze CPAN, Analyze CommunityAnalyze CPAN, Analyze Community
Analyze CPAN, Analyze Community
 
Annual Report 2012
Annual Report 2012Annual Report 2012
Annual Report 2012
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLite
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
CPANTS 2012
CPANTS 2012CPANTS 2012
CPANTS 2012
 
Revisiting ppm
Revisiting ppmRevisiting ppm
Revisiting ppm
 
変数、リファレンス
変数、リファレンス変数、リファレンス
変数、リファレンス
 
關於perl的 文件翻譯
關於perl的文件翻譯關於perl的文件翻譯
關於perl的 文件翻譯
 
Practical Bug Reporting
Practical Bug ReportingPractical Bug Reporting
Practical Bug Reporting
 
Top Tens of 2008/2009
Top Tens of 2008/2009Top Tens of 2008/2009
Top Tens of 2008/2009
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

2016年のPerl (Long version)

  • 1. 2016 年の Perl (Long version) Kenichi Ishigaki @charsbar YAPC::Hokkaido 2016 Dec 10, 2016
  • 2. Perl 5 in 2016
  • 3. Perl 5.24 was releasedSome of the notable changes: • Hashbang redirection to Perl 6 • autoderef was gone, postderef in • Unicode 8.0 support • Lexical $_ has been removed • /C/ character class has been removed • Nested declarations are not disallowed • chdir('') no longer chdirs home • sysread()/syswrite() and :utf8 handles • Performance enhancements • Several security fixes
  • 4. Good old hashbang redirection $ cat > hello.sh #!/bin/sh echo "Hello, World"; $ perl hello.sh Hello, World $ cat > hello.pl #!/usr/bin/env perl -w print "Hello, Worldn"; $ perl hello.pl Hello, World
  • 5. New hashbang redirection to Perl 6 $ cat > hello.p6 #!/home/ishigaki/.rakudobrew/bin/perl6 use v6; say "Hello, World"; $ perl5200 hello.p6 Perl v6.0.0 required--this is only v5.20.0, stopped at hello.p6 line 2. BEGIN failed--compilation aborted at hello.p6 line 2. $ perl5240 hello.p6 Hello, World
  • 6. auto-dereferencing • push $arrayref //= [], $scalar; • for (keys $hashref) { ... } • introduced in 5.14 • experimental since 5.18
  • 7. auto-dereferencing is gone × push $blessed_arrayref, $scalar; × for (keys $blessed_hashref) { ... } × print "interpolates $arrayref";
  • 8. • push $arrayref->@*, $scalar; • push $blessed_arrayref->@*, $scalar; • print "interpolates $arrayref->@*"; • experimental since 5.20 postderef is no longer experimental
  • 9. postderef is no longer experimental △ $undef->%* # warning × $maybe_undef->%* // {} ○ ($maybe_undef // {})->%* × keys ($maybe_hashref // {})->%* ○ keys (($maybe_hashref // {})->%*) ○ keys %{$maybe_hashref // {}} # shorter...
  • 10. Unicode 8.0 plackup -MEncode -e 'use 5.024; sub {[ 200, ["Content-Type" => "text/plain"], [encode_utf8("N{TACO} N{POPCORN}")], ]}'
  • 11. Unicode 8.0: Emoji Modifier plackup -MEncode -e 'use 5.024; sub {[ 200, ["Content-Type" => "text/plain"], [encode_utf8( "N{WOMAN}" . "N{EMOJI MODIFIER FITZPATRICK TYPE-5}" . " " . "N{MAN}" )], ]}'
  • 12. Lexical $_ has been removed • for my $_ (...) { ... } • implicitly used in given/when ( ~ 5.16) • has been experimental since 5.18. • See perl5180delta for details
  • 13. /C/ character class has been removed my $c = "N{U+3042}"; # あ say unpack "H*", $c; # e38182 $c =~ /(.)/; say sprintf "%x", $1; # 3042 $c =~ /(C)/; say sprintf "%x", $1; # e3 $c =~ s/(CC)C/$1x84/; say $c; # い • deprecated since 5.20
  • 14. Nested declarations are not disallowed my ($x, my($y)); # croaks now our (my $x); # ditto
  • 15. chdir(undef) no longer chdirs home chdir(undef) or die "since 5.24"; # but with no warning
  • 16. sysread()/syswrite() are deprecated on :utf8 handles use strict; use warnings; open my $fh, '<:encoding(cp932)', 'test.txt'; # works as you expect read($fh, my $buf, 3); # doesn't respect the encoding; now warns sysread($fh, my $buf, 3);
  • 17. Performance enchancements • The overhead of scope entry/exit is considerably reduced (subroutine calls, loops, and basic blocks become all faster) • /fixed-string/ become much faster (in many cases) • arithmetic become faster
  • 18. Security fixes • Perl 5.22 set a wrong umask before calling mkstemp(3) • Out of boundary access in Win32 path handling (since 5.005) • File::Spec::canonpath lost taint (since 5.20: PathTools-3.47) • Avoid accessing uninitialized memory in win32 crypt() • On duplicate environment variables from environ[]
  • 20. Some of the coming features/changes (Perl 5.26) • Unescaped literal { in regexp is not allowed (5.25.1) • Lexical subroutines are no longer experimental (5.25.2) • ${^ENCODING} has been removed (5.25.3) • Unicode 9.0 support (5.25.3) • Indented Here-documents (5.25.7) • Build option to exclude . in @INC (5.25.7)
  • 21. Unescaped literal { in regexp $foo =~ /d{1,10}/; # ok $foo =~ /d{1}/; # ok $foo =~ /something{}/; # now dies $foo =~ /something{/; # now dies $foo =~ /something[{]/; # ok $foo =~ /something{/; # ok $foo =~ /{}/; # still ok • deprecated since 5.16
  • 22. Lexical subroutines are no longer experimental { sub whatever { my $x = shift; my sub inner { ... do something with $x ... } inner(); } } perldoc perlsyn for details • experimental since 5.18
  • 23. ${^ENCODING} has been removed × use encoding 'cp932'; ○ use encoding 'cp932', Filter => 1;
  • 24. Good old Here-documents { my ($key, $value) = qw/foo bar/; my $json_template = << "END"; {"$key": "$value"} END }
  • 25. Indented Here-documents { my ($key, $value) = qw/foo bar/; my $json_template = <<~ "END"; {"$key": "$value"} END }
  • 26. Build option to exclude . in @INC $ plenv install 5.25.7 -Ddefault_inc_excludes_dot • Beware if you use inc::Module::Install, t:: for testing libraries, do "localfile.pl" for configuration, etc. • This issue would probably be mitigated somehow (by toolchainers). • Your system perl may have been built with the same option for security reasons. • FindBin is always your friend.
  • 28. Changes in the Community • Karen Pauley stepped down as TPF President • Perl 5 Pumpking: Ricardo Signes to Sawyer X • YAPC to The Perl Conferences 2017.06.18-23 (Alexandria, Virginia, USA) 2017.08.09-11 (Amsterdam, Netherlands)
  • 29. Other Perl Events happened in 2016 • Various Perl Workshops (Dutch, German, French, Alpine, Barcelona, London, DC-Baltimore, etc) • QA Hackathon in Rugby • meta::hack • Perl Dancer Conference 2016
  • 30. CPAN Status • 12915 PAUSE IDs (JP: 601) • 34607 Distributions As of Dec 10, 2016
  • 31. CPAN Status As of Dec 10, 2016 Number of releases Year Worldwide Japanese 2012 22647 1858 2013 25760 3225 2014 27269 1937 2015 22999 1108 2016 18898 731
  • 32. CPAN Status As of Dec 10, 2016 Number of released distributions Year Worldwide Japanese 2012 6777 539 2013 7442 804 2014 7586 566 2015 6823 407 2016 5957 306
  • 33. CPAN Status As of Dec 10, 2016 Number of new distributions Year Worldwide Japanese 2012 2947 (of 6777;43%) 248 (of 539;46%) 2013 2836 (of 7442;38%) 420 (of 804;52%) 2014 2805 (of 7586;37%) 220 (of 566;39%) 2015 2249 (of 6823;33%) 123 (of 407;30%) 2016 2072 (of 5957;35%) 77 (of 306;25%)
  • 34. CPAN Status As of Dec 10, 2016 Number of authors who released Year Worldwide Japanese 2012 1758 123 2013 1803 150 2014 1716 130 2015 1553 115 2016 1371 95
  • 35. CPAN Status As of Dec 10, 2016 Number of authors who released something new Year Worldwide Japanese 2012 1047 (of 1758;60%) 78 (of 123;63%) 2013 1012 (of 1803;56%) 113 (of 150;75%) 2014 898 (of 1716;52%) 78 (of 130;60%) 2015 734 (of 1553;47%) 66 (of 115;57%) 2016 608 (of 1371;44%) 38 (of 95;40%)
  • 36. CPAN Status App:: (375), Locale::CLDR::Locales:: (196), Net:: (195), Dist::Zilla::Plugin:: (141), Test:: (129), Bencher:: (119), Acme:: (117), Mojolicious::Plugin:: (104), Data:: (104), WWW:: (101), Text:: (77), WebService:: (68), Dancer2:: (67), Alien:: (64), HTML:: (64), DBIx:: (60), Math:: (60), File:: (59), Log:: (59)... Notable namespaces updated in 2016
  • 37. CPAN Status Char:: (35), App:: (14), Test:: (13), Plack::Middleware:: (12), Acme:: (10), Data:: (8), WebService:: (8), Redis (7), HTML:: (7), Net:: (7), Mojolicious::Plugin:: (6), DBIx:: (5), WWW:: (5), Text:: (5), Perl:: (4), SQL::(4), Net::Azure:: (4), AnyEvent (4), Dist:: (4)... Ditto by Japanese
  • 38. Perl 6 in 2016
  • 39. THE Christmas has come! ... as Larry announced last year.
  • 40. Now we have the Christmas ROAST • Repository Of All Spec Tests • "6.c" branch/tag in perl6/roast • We also have Rakudo that doesn't die by "use v6.c".
  • 41. $ perl6 -v This is Rakudo version 2016.11 built on MoarVM version 2016.11 implementing Perl 6.c. • say $*PERL.name; # Perl 6 • say $*PERL.version; # v6.c • say $*PERL.compiler.name; # rakudo • say $*PERL.compiler.version; # v2016.11 • say $*VM.name; # moar • say $*VM.version; # v2016.11
  • 42. Not everything is ready yet "spectest" (made from roast) is fudged. given $*DISTRO.name { when "macosx" { #?rakudo.jvm skip "file system events NYI? RT #124828" subtest &macosx, "does watch-path work on Mac OS X"; } default { pass "Nothing reliable to test yet"; } } perl6/roast/S17-supply/watch-path.t (for IO::Notification.watch-path)
  • 43. However, Rakudo is fairly STABLE now ... as long as you use the tested features.
  • 44. README for ROAST 6.c says: Any tests that contain a "use experimental" are not considered part of the specification, and their behavior is subject to change. Anything not explicitly tested here is experimental. https://github.com/perl6/roast/blob/6.c/README#L8-L10
  • 45. See the ROAST 6.c when in doubt • Design docs explain goals; not the current status. • 6.c-errata
  • 46. Performance and Reliability Among others, Jonathan Worthington... •completed his first 200-hours Perl 6 Performance and Reliability Grant •implemented heap snapshots in MoarVM •improved lower-level (ie. largely MoarVM) performance •fixed a number of memory leaks and concurrency bugs •This Grant has been extended for another 200 hours. http://news.perlfoundation.org/2016/08/perl-6-performance-and- reliabi-1.html
  • 47. According to a benchmark: https://twitter.com/zoffix/status/796810512986238978
  • 49. Rakudo on JVM • not included in Rakudo Star distributions now • much slower than Rakudo on MoarVM but improving
  • 51. Farewell to Parrot • First Perl6 backend since 2001 • Related code was removed from nqp https://p6weekly.wordpress.com/2016/08/01/2016-31-an-end-of- an-era/
  • 52. Release Utilities • Ticket Trakr • IRC release bot • http://blogs.perl.org/users/zoffix_znet/2016/08/i-botched-a- perl-6-release-and-now-a-robot-is-taking-my-job.html • https://github.com/rakudo/rakudo/blob/nom/docs/release_gu ide_automated.md
  • 53. TAP for Perl 6 • Tests in ROAST are written in Perl 6, but p5 Test::Harness is still used to run the tests. • New TAP.pm6 has been written to replace it. https://p6weekly.wordpress.com/2016/08/22/2016-34-a- quick-botch-from-cluj/
  • 54. Some of the (coming) features Not only grammars and concurrency but also... • Unicode support, not just to read/write • TWEAK (equiv to BUILD of p5 Moose) • lexical module loading
  • 55. Unicode support say 「こんにちはこんにちは」 ; # 半角「 」 のみ my $ 税率 = 1.08; ($ 金額 ×$ 税率 ).say; say 100² ÷ ⅕; # 50000; say 100 ** 2 / unival("x[2155]");
  • 56. TWEAK submethod Consider you want to set "id" automatically. use v6.c; class Foo { has ($.x, $!id); submethod BUILD() { $!id = $!x * 2; # $!x is not set yet } method generated_id { $!id } } say Foo.new(x => 1).generated_id; # 0
  • 57. TWEAK submethod You can write like this, but... use v6.c; class Foo { has ($.x, $!id); submethod BUILD(:$!x) { $!id = $!x * 2; } method generated_id { $!id } } say Foo.new(x => 1).generated_id; # 2
  • 58. TWEAK submethod use v6.c; # since 2016.11 (or v6.d when ready) class Foo { has ($.x, $!id); submethod TWEAK() { # called after BUILDs $!id = $!x * 2; } method generated_id { $!id } } say Foo.new(x => 1).generated_id; # 2
  • 59. Lexical module load not merged yet; this will break modules that depend on old, Perl5-like behavior. # A.pm6 class A {} # B.pm6 use A; class B {} # test_lexical_module_load.pl6 use B; A.new; # should die because A is not used here
  • 60. Perl 6 Ecosystem ~750 modules as of 2016/12 https://modules.perl6.org/
  • 61. Perl 6 Ecosystem Don't worry: you can use numerous Perl5 modules via Inline::Perl5. use v6.c use Inline::Perl5; use DBI:from<Perl5>; my $dbh = DBI.connect('dbi:Pg:database=test'); my $products = $dbh.selectall_arrayref( 'select * from products', {Slice => {}} );
  • 62. PSIXDISTS Perl5 toolchain ignores distribution under PAUSE_ID/Perl6/ directory. http://cpan.metacpan.org/authors/id/P/PS/PSIXDISTS/Perl6/
  • 63. Writing a Perl 6 module $ panda install App::Mi6 $ mi6 new Your::Great::Module
  • 64. Learning Perl 6 • Perl 6 Advent Calendars https://perl6advent.wordpress.com/ See also tests under roast/integration/ http://qiita.com/advent-calendar/2016/perl6 http://qiita.com/advent-calendar/2015/perl6 • Perl 6 Introduction: http://ja.perl6intro.com • RosettaCode https://rosettacode.org/wiki/Category:Perl_6 • roast • perl6.org
  • 65. Perl 6 Books Planned/In-Progress • Learning Perl 6 (brian d foy) https://www.kickstarter.com/projects/1422827986/learning-perl-6 • Perl 6 By Example (Moritz Lenz) https://perlgeek.de/blog-en/perl-6/2016-book.html
  • 66. Further Information • Weekly changes in and around Perl 6 https://p6weekly.wordpress.com • English videos about Perl 6 on YouTube http://bit.ly/perl6_english_video • WEB+DB PRESS Vol.93 「 Perl 6 の歩き 方」 http://gihyo.jp/dev/serial/01/perl-hackers-hub/003901 • About the next version (6.d) https://github.com/perl6/specs/blob/master/v6d.pod https://github.com/rakudo/rakudo/blob/nom/docs/language_