• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Continuing Evolution of Perl: Highlights of ActivePerl 5.14
 

Continuing Evolution of Perl: Highlights of ActivePerl 5.14

on

  • 2,062 views

 

Statistics

Views

Total Views
2,062
Views on SlideShare
2,061
Embed Views
1

Actions

Likes
0
Downloads
3
Comments
1

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • If you would like to watch this presentation, complete with discussion, you can download the recorded webcast at any time:

    http://www.activestate.com/webinars/continuing-evolution-perl
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Continuing Evolution of Perl: Highlights of ActivePerl 5.14 Continuing Evolution of Perl: Highlights of ActivePerl 5.14 Presentation Transcript

    • The Evolution of Perl:Highlights of Perl 5.14 and whats new in the Perl world
    • Agenda• Perl, ActivePerl, and ActiveState• Version support – from the community and ActiveState• Whats new in Perl 5.14• Re-factoring or maintaining existing code• Web frameworks and Plack/PSGI• Running Perl applications in the cloud
    • Perl• Created by Larry Wall in 1987• Perl 5 released in 1995 – language syntax stabilizes – first “extensible” version (use Some::Module)• Continued improvements through the 5.x series• Perl 6 – beyond the scope of this presentation – essentially a new language – a language specification, not an official compiler – Rakudo and other compilers available for early adopters
    • ActivePerl• ActiveState contracted by Microsoft to improve Perl performance and features for Windows• ActivePerl enhancements submitted back to core Perl• ActivePerl helps popularize Perl – 2 million downloads per year• adds some useful things – PPM (Perl Package Manager) – PerlCritic (from Perl Dev Kit) – PerlScript and Perl for ISAPI extensions
    • & PPM• CPAN is a one stop shop for user-created modules – standard toolchain for building, testing, and installing modules – searchable – standardized documentation format – bug tracking – HUGE: 23,000 modules (distributions)• PPM is ActivePerls client for installing these modules – command line and GUI interface – pre-compiled packages for specific platforms and Perl versions – dependencies handled automatically – provides most modules on CPAN (around 13,000 packages per platform)
    • Perl Releases• Perl releases used to be feature-based until 5.10 – released “when its done”• time-based releases since Perl 5.12 (April 2010) – no feature milestones to define the release – only features ready by release-time will be included – predictable upgrade schedule
    • Perl Support Policy• Perl community supports the most recent two releases – new features – security patches – bug fixes• ActiveState mirrors this policy for Community Edition• Older versions available through Business Edition, Enterprise Edition and OEM – extended support – professional services
    • Whats new in Perl 5.14• Unicode improvements• Reliable exception handling• Non-destructive substitution• more...
    • Unicode• Unicode 6.0 almost fully supported• N{NAME} and charnames enhancements• use feature unicode_strings
    • Regular Expressions• New character set modifiers: – /a ASCII – /d Default (or dodgy) – /l Locale – /u Unicode• Caution: Modified stringification! for example: qr/foo/i – Old: (?i-xsm:foo) – New: (?^i:foo)
    • Non-destructive substitution(my $copy = $orig) =~ s/cat/dog/;my $copy = $orig =~ s/cat/dog/r;my @copy = map { (my $copy = $_) =~ s/cat/dog/; $copy} @orig;my @copy = map { s/cat/dog/r } @orig;
    • Exception Handling• Problems: – eval() in DESTROY methods – die() in DESTROY methods – local $@• Solution: – Set $@ as late as possible before exiting the eval scope• Exceptions are now a lot more reliable
    • Don’t use smart-match• Smart match operator ~~ introduced in 5.10.0• “Fixed” in 5.10.1 because is wasn’t working• Still considered “too smart for it’s own good” • Over 20 rules on how it works • Rules apply recursively for container types• May be replaced by “dump match” in the future• All this applies to the given/when statements too.
    • Maintaining or updating Perl code Try running it with with a newer interpreter – it may just work. The interpreter will warn about deprecated code – incremental approach: 5.8 to 5.10 to 5.12 to 5.14 • use warnings; • less likely to “break” existing code • setting up each environment takes time and effort – direct approach: upgrading directly to 5.14 • address all the incompatibilities at once • opportunity to re-factor and use new language features • great excuse to write automated tests! – write tests for the old version first, then run them against 5.12
    • Consult perldelta• each Perl release has a list of differences and incompatibilities with the previous version – http://perldoc.perl.org/index-history.html – also in the ActivePerl documentation• pay particular attention to the Incompatible Changes section• dont skip a major version – the perldeltas are not cumulative - going from 5.10 to 5.14, check the 5.12 delta – you can skip odd numbered development releases (5.9, 5.11, etc.)
    • Check all modules• binary modules are NOT compatible between major Perl versions (e.g. 5.12 to 5.14)• update to the latest modules where possible• using PPM helps (ppm profile ...)• Check the modules Changes file and documentation
    • Use Perl::Critic• Perl::Critic – for examining your source code – uses Conways “Perl Best Practices” – points out bad or deprecated code and suggests alternatives• ActivePerl has a helpful GUI interface – added in 5.12 – formerly part of the Perl Dev Kit
    • ... or dont upgrade• You may choose not to upgrade to 5.12 or 5.14 – there are commercial support options:• ActivePerl Business Edition provides access to older builds of ActivePerl• ActivePerl Enterprise Edition can provide access and support for specific versions and platform builds• OEM licensing lets you distribute ActivePerl with your product
    • Web Frameworks and Plack/PSGI• Catalyst• Mojolicious• Dancer... all work with Plack/PSGI• interface between Perl web applications and web servers• simplifies web application deployment
    • Catalyst• most popular framework in a recent ActiveState survey – relatively speaking, its been around a long time (2005) – wide enterprise adoption• a “heavyweight” framework – many dependencies – very “TMTOWTDO” design, lots of choices for sub- components – very flexible
    • Mojolicious• new web framework from author of Catalyst, Sebastian Riedel• Mojo originally intended as a rewrite of Catalyst internals• lighter weight – fewer dependencies – “optimized for user-friendliness”
    • Dancer• micro-framework• for smaller sites, web services, or people who just prefer a very lightweight framework• similar to Rubys Sinatra or Pythons Flask
    • Perl in the cloudThe Platform as a Service approach proved very popular in the Ruby on Rails community – has also caught on with other languages and frameworks• a framework for frameworks... – not a PaaS... its for creating your own PaaS – supports multiple languages and frameworks – Perl web apps via PSGI – based on Cloud Foundry – more accessible for Perl and Python developers – http://activestate.com/cloud
    • Thank You Speak to a representative about ActivePerl Business Edition, Enterprise Edition or OEM: 1-866-510-2914 business-solutions@activestate.com www.activestate.com08/12/10