what's new in perl 5.14

133
What's new in Perl 5.14

Upload: andysh

Post on 18-Nov-2014

6.004 views

Category:

Technology


0 download

DESCRIPTION

An overview of new features appeared in the version 5.14 of the Perl programming language.

TRANSCRIPT

Page 1: What's new in Perl 5.14

What's new

in Perl 5.14

Page 2: What's new in Perl 5.14

perldoc perlhist

Page 3: What's new in Perl 5.14

5.10.02007−Dec−18

Page 4: What's new in Perl 5.14

5.10 appeared at its 20th birthday

Page 5: What's new in Perl 5.14

— Take part in our survey!

¿Are you using Perl >= 5.10?

Page 6: What's new in Perl 5.14

saywas introduced

Page 7: What's new in Perl 5.14

¿Are you using

say?

Page 8: What's new in Perl 5.14

Seriously

Page 9: What's new in Perl 5.14

The New History Began with

Page 10: What's new in Perl 5.14

Modern Perl

Page 11: What's new in Perl 5.14

Modern Perl

Page 12: What's new in Perl 5.14

ModernPerl

Page 13: What's new in Perl 5.14

Modern Perl termis often understood

too widely

Page 14: What's new in Perl 5.14

But it's just NOT these

Page 15: What's new in Perl 5.14
Page 16: What's new in Perl 5.14
Page 17: What's new in Perl 5.14

That's from a book published in 2009

Page 18: What's new in Perl 5.14

OK, go further:perldoc perlhist

Page 19: What's new in Perl 5.14

we'll skip all odd (not even) versions (5.11, 5.13) —

they are odd dev

Page 20: What's new in Perl 5.14

5.12.02010−Apr−12

Page 21: What's new in Perl 5.14

¿Are you using Perl >= 5.12?

— What is YAPC?

Page 22: What's new in Perl 5.14

5.14.0RC12011−Apr−20

Page 23: What's new in Perl 5.14

RC — is arelease candidate

Page 24: What's new in Perl 5.14

Then was

RC2

Page 25: What's new in Perl 5.14

And then

RC3

Page 26: What's new in Perl 5.14

Well, Perl 6's wayis much longer

Page 27: What's new in Perl 5.14

Perl 5.14is ready already

Page 28: What's new in Perl 5.14

What's newin Perl 5.14?

Page 29: What's new in Perl 5.14

perldoc perldelta

Page 30: What's new in Perl 5.14

perldelta = = 5.14 – 5.12

Page 31: What's new in Perl 5.14

NoticeAs described in perlpolicy, the release of Perl 5.14.0 marks the official end of support for Perl 5.10. Users of Perl 5.10 or earlier should consider upgrading to a more recent release of Perl.

Page 32: What's new in Perl 5.14

Frankly speaking, it's not that easy to

update Perl's versionon existing machine

Page 33: What's new in Perl 5.14

Modules are the most difficult part

Page 34: What's new in Perl 5.14

Do you know how to reinstall

everything easily?

Page 35: What's new in Perl 5.14

New

Page 36: What's new in Perl 5.14

Syntax

1

Page 37: What's new in Perl 5.14

Security

2

Page 38: What's new in Perl 5.14

Remember...

Page 39: What's new in Perl 5.14

register_globals = off

In PHP since version 4.2.0

$_GET["sql"]

Page 40: What's new in Perl 5.14

Perl is secureby itself

Page 41: What's new in Perl 5.14

Incompatibilities

3

Page 42: What's new in Perl 5.14

Deprecations

4

Page 43: What's new in Perl 5.14

Performance

5

Page 44: What's new in Perl 5.14

Modulesand pragmas

6

Page 45: What's new in Perl 5.14

Documentation

7

Page 46: What's new in Perl 5.14

Diagnostics

8

Page 47: What's new in Perl 5.14

Utilities

9

Page 48: What's new in Perl 5.14

Install process

10

Page 49: What's new in Perl 5.14

Platforms

11

Page 50: What's new in Perl 5.14

Internals

12

Page 51: What's new in Perl 5.14

Bug fixes

13

Page 52: What's new in Perl 5.14

Опечатки

14

Page 53: What's new in Perl 5.14

We'll only take a look at syntax and

regular expressions changes

Page 54: What's new in Perl 5.14

Welcome,

Unicode 6.0!

Page 55: What's new in Perl 5.14

(Well, it's time toWelcome, Perl 6.0!)

Page 56: What's new in Perl 5.14

Unicode affects both strings and regexes

Page 57: What's new in Perl 5.14

A bell

(fairy tale)

Page 58: What's new in Perl 5.14

ASCII-characterBELL (0x7)

Page 59: What's new in Perl 5.14

In Unicode 6.0BELL — 0x1F514

Page 60: What's new in Perl 5.14

Panic!

Page 61: What's new in Perl 5.14

Perl is calmand wise

Page 62: What's new in Perl 5.14

Perl is calmand wise

. . . probably

Page 63: What's new in Perl 5.14

In Perl

BELL  =  0x0007

Page 64: What's new in Perl 5.14

In Perl

BELL  =  0x0007\N{BELL}  =  0x0007

Page 65: What's new in Perl 5.14

In Perl

BELL  =  0x0007\N{BELL}  =  0x00070x0007  =  ALERT

Page 66: What's new in Perl 5.14

BELL  =  0x0007\N{BELL}  =  0x00070x0007  =  ALERTALERT  =  "\a"

Page 67: What's new in Perl 5.14

BELL  =  0x0007\N{BELL}  =  0x00070x0007  =  ALERTALERT  =  "\a"

\N{BEL}  =  0x0007

Page 68: What's new in Perl 5.14

BELL  =  0x0007\N{BELL}  =  0x00070x0007  =  ALERTALERT  =  "\a"

\N{BEL}  =  0x00070x1F514  —  no name

Page 69: What's new in Perl 5.14

BELL  =  0x0007\N{BELL}  =  0x00070x0007  =  ALERTALERT  =  "\a"

\N{BEL}  =  0x00070x1F514  —  no name

0x1F514  =                \N{U+1F514}

Page 70: What's new in Perl 5.14

ALERT  =  "\a"\N{BEL}  =  0x00070x1F514  —  no name

0x1F514  =                \N{U+1F514}

Plans for Perl 5.16

\N{BELL}  =  0x1F514

Page 71: What's new in Perl 5.14

0x1F514  —  без имени0x1F514  =                \N{U+1F514}

Plans for Perl 5.16

\N{BELL}  =  0x1F514

replace existing \N{BELL}with  \N{ALERT},\N{BEL}  or  "\a"

Page 72: What's new in Perl 5.14

use  feature  'unicode_strings';

Page 73: What's new in Perl 5.14

It brings the hope

Page 74: What's new in Perl 5.14

That everything is in Unicode

Page 75: What's new in Perl 5.14

How to turn 5.14 on

Page 76: What's new in Perl 5.14

use v5.14;

Page 77: What's new in Perl 5.14

use strict; adds itself

behind the scene

Page 78: What's new in Perl 5.14

vector stringversion string

abbreviated — v-string

5.10.0v5.10.0v5.10

Page 79: What's new in Perl 5.14
Page 80: What's new in Perl 5.14

What's new inregular expressions

Page 81: What's new in Perl 5.14

(?^  .  .  .)

Page 82: What's new in Perl 5.14

Switch off all the modifiers locally

Page 83: What's new in Perl 5.14

"ABC"  =~  /abc/i;

True

Page 84: What's new in Perl 5.14

False

"ABC"  =~  /a(?^:b)c/i;

Page 85: What's new in Perl 5.14

True

"ABC"  =~  /a(?^i:b)c/i;

Page 86: What's new in Perl 5.14

Ingenious reason

Page 87: What's new in Perl 5.14

$  perl5.14.0  -­‐MData::Dumper  -­‐E'my  $x  =  qr/abc/;  say  Dumper($x)'

$VAR1  =  qr/(?^u:abc)/;

No changes after adding new modifiers to Perl

Page 88: What's new in Perl 5.14

$  perl5.10.0  -­‐MData::Dumper  -­‐E'my  $x  =  qr/abc/;  say  Dumper($x)'

$VAR1  =  qr/(?-­‐xism:abc)/;

Will be changed after adding new modifiers to Perl

Page 89: What's new in Perl 5.14

New modifiers

Page 90: What's new in Perl 5.14

/l==

use  locale;

Page 91: What's new in Perl 5.14

/u==

use  feature  'unicode_strings';

Page 92: What's new in Perl 5.14

/d~~

no  locale;no  feature  

'unicode_strings';

Page 93: What's new in Perl 5.14

/d~~

no  locale;no  feature  

'unicode_strings';

bydefault

Page 94: What's new in Perl 5.14

/a

Page 95: What's new in Perl 5.14

How many charactersmatch with

/\d/

Page 96: What's new in Perl 5.14

How many charactersmatch with

/\d/

±420

Page 97: What's new in Perl 5.14

for  (0x0  ..  0x10FFFF)  {        my  $char  =  chr($_);        say  $char                if  $char  =~  /^\d$/;}

Page 98: What's new in Perl 5.14

/\d/ matches any symbol

marked DIGIT in Unicode

Page 99: What's new in Perl 5.14

0, 1, 2, 3, 4, 5, 6, 7, 8, 9,٠ ١, ٢, ٣, ٤, ٥, ٦, ٧, ٨, ٩, ੦,

੧, ੨, ੩, ੪, ੫, ੬, ੭, ੮, ੯, ૦, ૧,

૨, ૩, ૪, ૫, ૬, ૭, ૮, ૯, ௦, ௧, ௨,

௩, ௪, ௫, ௬, ௭, ௮, ௯, ...

Page 100: What's new in Perl 5.14

\d became a topic of arguments

Page 101: What's new in Perl 5.14

/d's behaviouris stable,

but contradictory

d

Page 102: What's new in Perl 5.14

/aWelcome

Page 103: What's new in Perl 5.14

for  (0x0  ..  0x10FFFF)  {        my  $char  =  chr($_);        say  $char                if  $char  =~  /^\d$/a;}

Page 104: What's new in Perl 5.14

Only 10 ASCIIcharacters match

$  perl  a1.pl  |  wc  -­‐l10

Page 105: What's new in Perl 5.14

/a createsASCII versions

of the modifiers\d, \s и \w

Page 106: What's new in Perl 5.14

And affects both \b and \B

Page 107: What's new in Perl 5.14

/r

Page 108: What's new in Perl 5.14

Non-destructive substitution

Page 109: What's new in Perl 5.14

A substitutionthat do not change

original string

Page 110: What's new in Perl 5.14

use  v5.14;

my  $version  =  "Perl  5.10";say  $version  =~  s/5\.10/5.14/r;  

Result: Perl  5.14

Page 111: What's new in Perl 5.14

my $english = "colour";my $american = $english =~ s/our/or/r;

Page 112: What's new in Perl 5.14

Arrays and hashes

Page 113: What's new in Perl 5.14

Extra noise chars to be removed

Page 114: What's new in Perl 5.14

That featureis experimental

Page 115: What's new in Perl 5.14

use  v5.14;

my  $a  =  [];push  $a,  3,  5,  7;

Page 116: What's new in Perl 5.14

use  v5.10;

my  $a  =  [];push  @$a,  3,  5,  7;

Page 117: What's new in Perl 5.14

(Likewise @a[1] in Perl 6)

Page 118: What's new in Perl 5.14

And more

Page 119: What's new in Perl 5.14

push/pop  @$arrayref

push/pop  $arrayref

Page 120: What's new in Perl 5.14

shift/unshift  @$arrayref

shift/unshift  $arrayref

Page 121: What's new in Perl 5.14

splice  @$arrayref

splice  $arrayref

Page 122: What's new in Perl 5.14

keys/values  %$hashref

keys/values  $hashref

Page 123: What's new in Perl 5.14

keys/values  @$arrayref

keys/values  $arrayref

Page 124: What's new in Perl 5.14

each  %$href  /  @$aref

each  $href  /  $aref

Page 125: What's new in Perl 5.14

given returns the last

evaluated value

Page 126: What's new in Perl 5.14

say  mysub(7);

sub  mysub  {        given($_[0])  {              "few"    when  3;              "OK"      when  5;              "many"  when  7;              "?";        }}

Page 127: What's new in Perl 5.14

(For thosewho omit

return keyword)

Page 128: What's new in Perl 5.14

git blame

Page 129: What's new in Perl 5.14

Aaron Crane, Abhijit Menon-Sen, Abigail, Ævar Arnfjörð Bjarmason, Alastair Douglas, Alexander Alekseev, Alexander Hartmaier, Alexandr Ciornii, Alex Davies, Alex Vandiver, Ali Polatel, Allen Smith, Andreas König, Andrew Rodland, Andy Armstrong, Andy Dougherty, Aristotle Pagaltzis, Arkturuz, Arvan, A. Sinan Unur, Ben Morrow, Bo Lindbergh, Boris Ratner, Brad Gilbert, Bram, brian d foy, Brian Phillips, Casey West, Charles Bailey, Chas. Owens, Chip Salzenberg, Chris 'BinGOs' Williams, chromatic, Craig A. Berry, Curtis Jewell, Dagfinn Ilmari Mannsåker, Dan Dascalescu, Dave Rolsky, David Caldwell, David Cantrell, David Golden, David Leadbeater, David Mitchell, David Wheeler, Eric Brine, Father Chrysostomos, Fingle Nark, Florian Ragwitz, Frank Wiegand, Franz Fasching, Gene Sullivan, George Greer, Gerard Goossen, Gisle Aas, Goro Fuji, Grant McLean, gregor herrmann, H.Merijn Brand, Hongwen Qiu, Hugo van der Sanden, Ian Goodacre, James E Keenan, James Mastros, Jan Dubois, Jay Hannah, Jerry D. Hedden, Jesse Vincent, Jim Cromie, Jirka Hruška, John Peacock, Joshua ben Jore, Joshua Pritikin, Karl Williamson, Kevin Ryde, kmx, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯, Larwan

Berke, Leon Brocard, Leon Timmermans, Lubomir Rintel, Lukas Mai, Maik Hentsche, Marty Pauley, Marvin Humphrey, Matt Johnson, Matt S Trout, Max Maischein, Michael Breen, Michael Fig, Michael G Schwern, Michael Parker, Michael Stevens, Michael Witten, Mike Kelly, Moritz Lenz, Nicholas Clark, Nick Cleaton, Nick Johnston, Nicolas Kaiser, Niko Tyni, Noirin Shirley, Nuno Carvalho, Paul Evans, Paul Green, Paul Johnson, Paul Marquess, Peter J. Holzer, Peter John Acklam, Peter Martini, Philippe Bruhat (BooK), Piotr Fusik, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Renee Baecker, Ricardo Signes, Richard Möhn, Richard Soderberg, Rob Hoelz, Robin Barker, Ruslan Zakirov, Salvador Fandiño, Salvador Ortiz Garcia, Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Steffen Müller, Steve Hay, Steven Schubiger, Steve Peters, Sullivan Beck, Tatsuhiko Miyagawa, Tim Bunce, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Tye McQueen, Vadim Konovalov, Vernon Lyon, Vincent Pit, Walt Mankowski, Wolfram Humann, Yves Orton, Zefram и Zsbán Ambrus.

Page 130: What's new in Perl 5.14

use v5.14 or die;

Page 131: What's new in Perl 5.14

Or at least

Page 132: What's new in Perl 5.14

use v5.14 or v5.12 ;-)

Page 133: What's new in Perl 5.14

__END__

Andrew Shitov [email protected]