Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Charlotte Perl Mongers Kickoff
Search
Jason A. Crome
January 10, 2019
Programming
0
27
Charlotte Perl Mongers Kickoff
The restart of Charlotte Perl Mongers, with a graceful introduction to Modern Perl programming.
Jason A. Crome
January 10, 2019
Tweet
Share
More Decks by Jason A. Crome
See All by Jason A. Crome
Constructing Command Line Applications in Perl
cromedome
0
88
Accessibility in Web Sites
cromedome
0
23
Building a Honeypot
cromedome
0
53
Dependency Management with Carton
cromedome
0
39
Scraping Tumblr
cromedome
0
53
wEdge for Treasurers (and everyone else, too!)
cromedome
0
37
Integration Points for Property Tax, CAMA, & GIS
cromedome
0
260
Other Decks in Programming
See All in Programming
Leading Effective Engineering Teams in the AI Era
addyosmani
7
450
非同期jobをtransaction内で 呼ぶなよ!絶対に呼ぶなよ!
alstrocrack
0
970
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
240
私はどうやって技術力を上げたのか
yusukebe
44
19k
作って理解するGOCACHEPROG / Go Conference 2025(Workshop)
mazrean
0
100
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
210
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
2
550
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
3.3k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
300
株式会社 Sun terras カンパニーデック
sunterras
0
330
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Become a Pro
speakerdeck
PRO
29
5.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Agile that works and the tools we love
rasmusluckow
331
21k
The Straight Up "How To Draw Better" Workshop
denniskardys
238
140k
Rails Girls Zürich Keynote
gr2m
95
14k
Typedesign – Prime Four
hannesfritz
42
2.8k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Transcript
Welcome to Charlotte Perl Mongers! Jason A. Crome Senior Perl
Developer, Empowered January 10, 2019 Copyright (C) 2019, Jason A. Crome
Who are we?
What is Perl Mongers? • Grassroots organization for promoting Perl
• Run by volunteers (and zealots like me!) • Share and disseminate information about Perl and the community • Welcome to Charlotte.pm!
Engage with us! • Us = all of you! •
Use our Meetup • charlottedevs.slack.com#perl • irc.perl.org#charlotte.pm
What is Modern Perl?
What is Modern Perl? • First-class OO programming • Great
Testing Infrastructure • Deployment and Configuration Toolchain • Active user community • Modern language features • Modern frameworks
Who’s Using Modern Perl? • ZipRecruiter • Booking.com • Craigslist
• Ticketmaster • Amazon • BBC • NASA • Rent.com • DuckDuckGo • IMDB • Empowered • ShutterStock • ServerCentral • Pinboard
What is Modern Perl? • First-class OO programming • Great
Testing Infrastructure • Deployment and Configuration Toolchain • Active user community • Modern language features • Modern frameworks
Object Oriented • Moose • Moo • Mouse
package Point; sub new { my ($class, $x, $y) =
@_; my $self = { x => $x, y => $y, }; return bless $self, $class; } sub get_x { return $_[0]->{x}; } sub set_x { return $_[0]->{x} = $_[1]; } sub get_y { return $_[0]->{y}; } sub set_y { return $_[0]->{y} = $_[1]; } 1;
package Point; use Moose; has 'x' => (isa => 'Int',
is => 'rw', required => 1); has 'y' => (isa => 'Int', is => 'rw', required => 1); sub clear { my $self = shift; $self->x(0); $self->y(0); } package Point3D; use Moose; extends 'Point'; has 'z' => (isa => 'Int', is => 'rw', required => 1); after 'clear' => sub { my $self = shift; $self->z(0); };
# hash or hashrefs are ok for the constructor my
$point1 = Point->new(x => 5, y => 7); my $point2 = Point->new({x => 5, y => 7}); my $point3d = Point3D->new(x => 5, y => 42, z => -5); Using the Point Class
Roles with Moose package MyApp::CLI::SetPassword; use strictures 2; use MooseX::App::Command;
extends qw( MyApp::CLI ); with qw( MyApp::Role::CLI::WithPassword MyApp::Role::CLI::WithUsername MyApp::Role::CLI::WithUser ); use MyApp::Module; sub run ( $self ) { $self->_say( "Changing password for " . $self->username . '...' ); $self->user->password( $self->password ); $self->user->update; say "Done!"; } 1;
Testing Infrastructure • Test2 • Test::Class::Moose • prove • TAP
Deployment/Configuration • Plack/PSGI • cpanfile • Carton • Pinto •
perlbrew • plenv
Community • Perl’s greatest strength • Perl Mongers • YAPC
/ TPC • (Meta)CPAN
MetaCPAN
Modern Language Features/Tools • Named parameters/sub signatures • Meta-object protocol
• XS • Pod • Perlcritic • Perltidy
Named params/sub signatures sub clear( $self ) { $self->x(0); $self->y(0);
} after 'clear' => sub( $self ) { $self->z(0); }; sub set( $self, $x, $y, $z?) { $self->x( $x ); $self->y( $y ); $self->z( $z ) if $z; }
Modern Frameworks • Object Frameworks • ORMs • Templating Frameworks
• Web App Frameworks
ORMs • Class::DBI • DBIx::Class • Rose::DB
DBIx::Class $user = $schema->resultset('User')->find( { email => $self->email } );
$user = $schema->resultset('User')->create( { username => $self->username, password => $self->password, email => $self->email, } ); my $user_rs = $schema->resultset('User')->search({ email => { like => '%example.com' }, },{ order_by => { username => 'ASC' }, } );
Templating Frameworks • HTML::Template • Mason • Template Toolkit •
Mustache • XSlate • And many, many others…
Web App Frameworks
And now, live coding and swag!
Questions?
Thanks! https://empowered.net jcrome@empoweredbenefits.com Twitter: @cromedome