SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Perl 5.16 new features




Perl Mova              Kiev, Ukraine


       Pavel Vlasov, 2012
Content

1.Perl 5.16 coming
2.Unicode features
3.Other features
4.New documentation
5.Performance
1. Perl 5.16 coming

• Development of Perl 5 (1994 – now)
  - 18 years

• Release date of Perl 5.16
  - 16 may 2012 (in next few days)
1. Perl 5.16 coming

• Perl 5.14 – 14 may 2011
• Perl 5.16 – 16 may 2012
…....
• Perl 5.30 – 30 may 2026
• Perl 5.32 - ?????
2. Unicode features


 •   fc (fold case)
 •   quotameta
 •   unicode_eval
 •   evalbytes
2. Fold case
• Compare strings non-unicode
uc($string1) eq = uc($string2)

$string1 = ‘A’; $string2 = ‘a’;
uc(‘A’) = A     uc(‘a) =A
Result: OK


$string1 = ‘ß’;
uc(‘ß’) = ‘SS’

It’s NOT OK
2. Fold case

• Compare strings in unicode

  use feature ‘fc’;
  fc($unicode1) eq fc($unicode2)

• Use casefolding
• inside a double-quoting string - "F$variable"
2. quotameta

• In Perl 5.16 adopted a Unicode-defined strategy for quoting
  non-ASCII characters

  my $string = ‘Perl May 2011 in Moscow';
  my $substr = ‘May.*?Moscow';
  $string =~ s{Q$substrE}{Mova 2012 in Kiev};

• Or:

  use feature ‘unicode_strings’;
  my $string = ‘Perl May 2011 in Moscow';
  my $substr = ‘May.*?Moscow';
  my $quoted_substr = quotemeta($substr);
  $string =~ s{$quoted_substr}{Mova 2012 in Kiev};
2. unicode_eval, evalbytes

unicode_eval default feature of Perl 5.16
   eval – evaluate string of characters

evalbytes – die if the string contains any
  characters outside the 8-bit range
3. Other features

•   current sub __SUB__
•   CORE namespace
•   array base
•   debugger
3. Current sub

• current_sub (__SUB__) - reference to the current
  subroutine or undef outside of subroutine
• easier to write recursive closures.

use feature ‘current_sub’;
sub closure {
  my $init = shift;

    return sub {
        state $counter = $init;
        return if $counter++ > 10;
        __SUB__->();
    }
}
3. CORE Namespace

• Namespace for Perl’s core routines
• Give access to the original built-in of Perl

use v5.16;
   or
use feature ‘say’;
   or
CORE::say “yes”;
3. array base

• special variable for array base
• The 'array_base' feature replace variable $[
• $[ affected also string not only arrays

use feature ‘array_base’;
$[ = 1;
3. debugger


• Tracing mode (t command) accept number of
  subroutine for trace

• Breakpoints with file names
$ b [file]:[line] [condition]
$ b lib/MyModule.pm:237 $x > 30
4. New documentation

•   perldtrace
•   perlexperiment
•   perlootut
•   perlxstypemap
5. Performance

 Improved performance for Unicode
 properties in regexp
 local $_ is faster now



 More? perl5160delta.pod
Used resources


• Perl5160delta.pod
• www.effectiveperlprogramming.com
• Mailing list of p5p
Thank you for attention!

paul.vlasov@gmail.com

Mais conteúdo relacionado

Mais procurados

Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
Pramod Kumar
 
c++ Lecture 3
c++ Lecture 3c++ Lecture 3
c++ Lecture 3
sajidpk92
 
02 - Second meetup
02 - Second meetup02 - Second meetup
02 - Second meetup
EdiPHP
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
Xinchen Hui
 
Unit 4
Unit 4Unit 4
Unit 4
siddr
 

Mais procurados (20)

Perl one liners
Perl one linersPerl one liners
Perl one liners
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-liners
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol Resolution
 
Java 8 - project lambda
Java 8 - project lambdaJava 8 - project lambda
Java 8 - project lambda
 
Elements of C++11
Elements of C++11Elements of C++11
Elements of C++11
 
How Functions Work
How Functions WorkHow Functions Work
How Functions Work
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
 
c++ Lecture 3
c++ Lecture 3c++ Lecture 3
c++ Lecture 3
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/Proxy
 
Introduction to Perl Programming
Introduction to Perl ProgrammingIntroduction to Perl Programming
Introduction to Perl Programming
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
 
Php engine
Php enginePhp engine
Php engine
 
02 - Second meetup
02 - Second meetup02 - Second meetup
02 - Second meetup
 
The Ring programming language version 1.3 book - Part 60 of 88
The Ring programming language version 1.3 book - Part 60 of 88The Ring programming language version 1.3 book - Part 60 of 88
The Ring programming language version 1.3 book - Part 60 of 88
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
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)
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Clojure 7-Languages
Clojure 7-LanguagesClojure 7-Languages
Clojure 7-Languages
 
The Ring programming language version 1.9 book - Part 101 of 210
The Ring programming language version 1.9 book - Part 101 of 210The Ring programming language version 1.9 book - Part 101 of 210
The Ring programming language version 1.9 book - Part 101 of 210
 
Unit 4
Unit 4Unit 4
Unit 4
 

Destaque

プリントアウトのコストダウンのコツ《総務・経理の方へ》
プリントアウトのコストダウンのコツ《総務・経理の方へ》プリントアウトのコストダウンのコツ《総務・経理の方へ》
プリントアウトのコストダウンのコツ《総務・経理の方へ》
吉田印刷所
 
Sqa sg sheet
Sqa sg sheetSqa sg sheet
Sqa sg sheet
nmcquade
 
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
吉田印刷所
 
Mans nākotnes novads2
Mans nākotnes  novads2Mans nākotnes  novads2
Mans nākotnes novads2
egilsdo
 
Tesol summer institute 2014 giving student feedback
Tesol summer institute 2014  giving student feedbackTesol summer institute 2014  giving student feedback
Tesol summer institute 2014 giving student feedback
Telly J Hajny
 
Pašv sad saldus_101111
Pašv sad saldus_101111Pašv sad saldus_101111
Pašv sad saldus_101111
egilsdo
 

Destaque (20)

Un sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientalesUn sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientales
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
プリントアウトのコストダウンのコツ《総務・経理の方へ》
プリントアウトのコストダウンのコツ《総務・経理の方へ》プリントアウトのコストダウンのコツ《総務・経理の方へ》
プリントアウトのコストダウンのコツ《総務・経理の方へ》
 
Sqa sg sheet
Sqa sg sheetSqa sg sheet
Sqa sg sheet
 
Questions 4-7
Questions 4-7Questions 4-7
Questions 4-7
 
The 'Client' Template - Illustrated!
The 'Client' Template - Illustrated!The 'Client' Template - Illustrated!
The 'Client' Template - Illustrated!
 
Presentacion Informatica
Presentacion InformaticaPresentacion Informatica
Presentacion Informatica
 
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
環境・エコロジー担当の方へ「ムダな印刷物をなくす吉田印刷所の提案」
 
Nofta postharvest financing project
Nofta postharvest financing projectNofta postharvest financing project
Nofta postharvest financing project
 
Mans nākotnes novads2
Mans nākotnes  novads2Mans nākotnes  novads2
Mans nākotnes novads2
 
Bullying
BullyingBullying
Bullying
 
Eidn 3-sinamob
Eidn 3-sinamobEidn 3-sinamob
Eidn 3-sinamob
 
Khmer culture, civilization (part4)
Khmer culture, civilization (part4)Khmer culture, civilization (part4)
Khmer culture, civilization (part4)
 
We didn't watch tv
We didn't watch tvWe didn't watch tv
We didn't watch tv
 
Bahan kuliah 1
Bahan kuliah 1 Bahan kuliah 1
Bahan kuliah 1
 
Ce este agenţia de ştiri
Ce este agenţia de ştiriCe este agenţia de ştiri
Ce este agenţia de ştiri
 
Tesol summer institute 2014 giving student feedback
Tesol summer institute 2014  giving student feedbackTesol summer institute 2014  giving student feedback
Tesol summer institute 2014 giving student feedback
 
191 195
191 195191 195
191 195
 
3INVESTONLINE.COM
3INVESTONLINE.COM3INVESTONLINE.COM
3INVESTONLINE.COM
 
Pašv sad saldus_101111
Pašv sad saldus_101111Pašv sad saldus_101111
Pašv sad saldus_101111
 

Semelhante a Perl 5.16 new features

Php basics
Php basicsPhp basics
Php basics
hamfu
 

Semelhante a Perl 5.16 new features (20)

Syntax
SyntaxSyntax
Syntax
 
Php basics
Php basicsPhp basics
Php basics
 
Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010
 
Swift, functional programming, and the future of Objective-C
Swift, functional programming, and the future of Objective-CSwift, functional programming, and the future of Objective-C
Swift, functional programming, and the future of Objective-C
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perl
 
Modern Perl Catch-Up
Modern Perl Catch-UpModern Perl Catch-Up
Modern Perl Catch-Up
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
 
Damien seguy php 5.6
Damien seguy php 5.6Damien seguy php 5.6
Damien seguy php 5.6
 
Slide
SlideSlide
Slide
 
The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202
 
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner) Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
 
Introducing perl6
Introducing perl6Introducing perl6
Introducing perl6
 
Ruby basics
Ruby basicsRuby basics
Ruby basics
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
Introduction in php part 2
Introduction in php part 2Introduction in php part 2
Introduction in php part 2
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to Scala
 
Practical approach to perl day1
Practical approach to perl day1Practical approach to perl day1
Practical approach to perl day1
 
Elixir: the not-so-hidden path to Erlang
Elixir: the not-so-hidden path to ErlangElixir: the not-so-hidden path to Erlang
Elixir: the not-so-hidden path to Erlang
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Perl 5.16 new features

  • 1. Perl 5.16 new features Perl Mova Kiev, Ukraine Pavel Vlasov, 2012
  • 2. Content 1.Perl 5.16 coming 2.Unicode features 3.Other features 4.New documentation 5.Performance
  • 3. 1. Perl 5.16 coming • Development of Perl 5 (1994 – now) - 18 years • Release date of Perl 5.16 - 16 may 2012 (in next few days)
  • 4. 1. Perl 5.16 coming • Perl 5.14 – 14 may 2011 • Perl 5.16 – 16 may 2012 ….... • Perl 5.30 – 30 may 2026 • Perl 5.32 - ?????
  • 5. 2. Unicode features • fc (fold case) • quotameta • unicode_eval • evalbytes
  • 6. 2. Fold case • Compare strings non-unicode uc($string1) eq = uc($string2) $string1 = ‘A’; $string2 = ‘a’; uc(‘A’) = A uc(‘a) =A Result: OK $string1 = ‘ß’; uc(‘ß’) = ‘SS’ It’s NOT OK
  • 7. 2. Fold case • Compare strings in unicode use feature ‘fc’; fc($unicode1) eq fc($unicode2) • Use casefolding • inside a double-quoting string - "F$variable"
  • 8. 2. quotameta • In Perl 5.16 adopted a Unicode-defined strategy for quoting non-ASCII characters my $string = ‘Perl May 2011 in Moscow'; my $substr = ‘May.*?Moscow'; $string =~ s{Q$substrE}{Mova 2012 in Kiev}; • Or: use feature ‘unicode_strings’; my $string = ‘Perl May 2011 in Moscow'; my $substr = ‘May.*?Moscow'; my $quoted_substr = quotemeta($substr); $string =~ s{$quoted_substr}{Mova 2012 in Kiev};
  • 9. 2. unicode_eval, evalbytes unicode_eval default feature of Perl 5.16 eval – evaluate string of characters evalbytes – die if the string contains any characters outside the 8-bit range
  • 10. 3. Other features • current sub __SUB__ • CORE namespace • array base • debugger
  • 11. 3. Current sub • current_sub (__SUB__) - reference to the current subroutine or undef outside of subroutine • easier to write recursive closures. use feature ‘current_sub’; sub closure { my $init = shift; return sub { state $counter = $init; return if $counter++ > 10; __SUB__->(); } }
  • 12. 3. CORE Namespace • Namespace for Perl’s core routines • Give access to the original built-in of Perl use v5.16; or use feature ‘say’; or CORE::say “yes”;
  • 13. 3. array base • special variable for array base • The 'array_base' feature replace variable $[ • $[ affected also string not only arrays use feature ‘array_base’; $[ = 1;
  • 14. 3. debugger • Tracing mode (t command) accept number of subroutine for trace • Breakpoints with file names $ b [file]:[line] [condition] $ b lib/MyModule.pm:237 $x > 30
  • 15. 4. New documentation • perldtrace • perlexperiment • perlootut • perlxstypemap
  • 16. 5. Performance Improved performance for Unicode properties in regexp local $_ is faster now More? perl5160delta.pod
  • 17. Used resources • Perl5160delta.pod • www.effectiveperlprogramming.com • Mailing list of p5p
  • 18. Thank you for attention! paul.vlasov@gmail.com