SlideShare a Scribd company logo
1 of 21
Set yourself free from 
the system: managing 
non-system Perls 
Jose Luis Martínez Torres 
JLMARTIN 
Barcelona Perl Workshop 2014 
@pplu_io
System perl 
 Debian 
 squeeze: 5.10 
 wheezy: 5.14 
 jessie: 5.20 
 Redhat 
 RHEL5: 5.8 
 RHEL6: 5.10 
 RHEL7: 5.16
The distribution perl is not what you 
think it is 
For Debian Perl 5.14 
$ /usr/bin/perl -V | grep DEBPKG | wc -l 
57
The distribution perl is not what you 
think it is 
http://perlbuzz.com/2008/08/red-hats-patch-slows-down-overloading-in-perl. 
html 
Some investigation revealed that there’s a long standing bug in Redhat Perl that 
causes *severe* performance degradation on code that uses the bless/overload 
combo. The thread on this is here: 
https://bugzilla.redhat.com/show_bug.cgi?id=379791
The distribution perl is not what you 
think it is 
http://perlbuzz.com/2008/08/red-hats-patch-slows-down-overloading-in-perl. 
html 
Some investigation revealed that there’s a long standing bug in Redhat Perl that 
causes *severe* performance degradation on code that uses the bless/overload 
combo. The thread on this is here: 
https://bugzilla.redhat.com/show_bug.cgi?id=379791
Compile my own perl? Hard??? 
In the olden days it could be a challenge
Compile my own perl: Now 
No need for root! 
You only need compiler (and libs) 
apt-get install build-essential 
Now you choose: perlbrew / plenv 
I’ll use plenv today… (like it more)
Plenv to the rescue 
https://github.com/tokuhirom/plenv/ 
git clone git://github.com/tokuhirom/plenv.git ~/.plenv 
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.profile 
echo 'eval "$(plenv init -)"' >> ~/.profile 
exec $SHELL –l 
git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/ 
plenv install 5.20.1 
# wait for it… 
plenv rehash 
plenv install-cpanm
A Word of Caution 
#!/usr/bin/perl is soooooooooooo 2010… 
#!/usr/bin/env perl is the new #!/usr/bin/perl 
It’ll help your programs find the correct perl!
Switching perls 
(At the directory level) 
plenv global 5.16.2 
cd project1 
plenv local 5.14.0 
./my_project
My Modules! 
carton to the rescue
Carton 
cpanm Carton 
vi cpanfile 
requires ‘Module1’; 
requires ‘Module2’; 
carton install 
# Magic happens… All modules get installed 
# Also generates a cpanfile.snapshot with all modules and versions 
installed 
carton exec ./my_project
Trick 
carton exec $SHELL –l 
#Perl will find your modules 
without invoking carton
Handling failures
Handling failures 
 Look at the log 
 Normally some headers missing 
DBD::mysql requires libmysqlclient-dev to be installed (Debian/Ubuntu) 
SSL related modules usually require OpenSSL: libssl-dev (Debian/Ubuntu) 
Some XML related modules require libexpat1-dev libxml2-dev 
Find a missing .h file in the compiler errors, and find which package it belongs to 
Rinse and Repeat “carton install”
BUNDLE!!! 
carton bundle 
- Look at your vendor/cache dir! 
- Look at vendor/bin! 
./vendor/bin/carton (fat packed version) 
I personally add the vendor directory to version control 
Smells like we get repeatable 
DEPLOY!!! 
carton install 
# install all modules that don’t meet cpanfile requirements 
carton install --deployment 
# installs all versions from cpanfile.snapshot 
carton install --deployment --cached 
# installs versions from the vendor/cache
Conclusions 
 plenv controls your Perl version 
 carton controls your dependencies 
 Enables 
 Repeatablility 
 Independant interpreters for different needs (think of microservices) 
 Testing new versions 
 Using up-to-date modules with no fear of CPAN breakage
Thanks 
Tokuhiro Matsuno for plenv 
Tatsuhiko Miyagawa for carton
Extra, Extra
Extra, Extra: Here’s the cat

More Related Content

Viewers also liked

Estilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjaEstilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjavitorneves79
 
Rancangan Pengajaran Harian Matematik (Mikropengajaran)
Rancangan Pengajaran Harian Matematik (Mikropengajaran)Rancangan Pengajaran Harian Matematik (Mikropengajaran)
Rancangan Pengajaran Harian Matematik (Mikropengajaran)jocelynlly
 
Questionnaire results
Questionnaire resultsQuestionnaire results
Questionnaire resultskamar95
 
Garm2 raton sin pilas
Garm2 raton sin pilasGarm2 raton sin pilas
Garm2 raton sin pilasjaiip
 
Grade 8 9 course selection 2014-2015
Grade 8 9 course selection 2014-2015Grade 8 9 course selection 2014-2015
Grade 8 9 course selection 2014-2015SteveAyling
 
Infinity
InfinityInfinity
Infinityjs229
 
My fist drafts presnetation
My fist drafts presnetationMy fist drafts presnetation
My fist drafts presnetationkamar95
 
θουκυδίδου ι αγνωστο θεμα
θουκυδίδου ι αγνωστο θεμαθουκυδίδου ι αγνωστο θεμα
θουκυδίδου ι αγνωστο θεμαEfi Manousaka
 

Viewers also liked (16)

Huidobro&Sepulveda_2010
Huidobro&Sepulveda_2010Huidobro&Sepulveda_2010
Huidobro&Sepulveda_2010
 
Polifonia.4.12
Polifonia.4.12Polifonia.4.12
Polifonia.4.12
 
Estilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjaEstilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mja
 
Web2 0
Web2 0Web2 0
Web2 0
 
jul-ago-00
jul-ago-00jul-ago-00
jul-ago-00
 
Pptplan morgenjuli2011 pptbehandelcoordinatoren
Pptplan morgenjuli2011 pptbehandelcoordinatorenPptplan morgenjuli2011 pptbehandelcoordinatoren
Pptplan morgenjuli2011 pptbehandelcoordinatoren
 
Rancangan Pengajaran Harian Matematik (Mikropengajaran)
Rancangan Pengajaran Harian Matematik (Mikropengajaran)Rancangan Pengajaran Harian Matematik (Mikropengajaran)
Rancangan Pengajaran Harian Matematik (Mikropengajaran)
 
Questionnaire results
Questionnaire resultsQuestionnaire results
Questionnaire results
 
Garm2 raton sin pilas
Garm2 raton sin pilasGarm2 raton sin pilas
Garm2 raton sin pilas
 
Grade 8 9 course selection 2014-2015
Grade 8 9 course selection 2014-2015Grade 8 9 course selection 2014-2015
Grade 8 9 course selection 2014-2015
 
Infinity
InfinityInfinity
Infinity
 
My fist drafts presnetation
My fist drafts presnetationMy fist drafts presnetation
My fist drafts presnetation
 
θουκυδίδου ι αγνωστο θεμα
θουκυδίδου ι αγνωστο θεμαθουκυδίδου ι αγνωστο θεμα
θουκυδίδου ι αγνωστο θεμα
 
DBIx::Class
DBIx::ClassDBIx::Class
DBIx::Class
 
introduccion
introduccionintroduccion
introduccion
 
Bloedsomloop versie 1.0
Bloedsomloop versie 1.0Bloedsomloop versie 1.0
Bloedsomloop versie 1.0
 

Similar to Plenv and carton

Managing Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewManaging Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewBaden Hughes
 
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12ActiveState
 
FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011rivierarb
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Tim Bunce
 
PRoot improved kernel compatibility
PRoot improved kernel compatibilityPRoot improved kernel compatibility
PRoot improved kernel compatibilitycvinc02
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)Thierry Gayet
 
Carton
CartonCarton
Cartontaggg
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015ice799
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Levente Kurusa
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packagesJeremiah Foster
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 

Similar to Plenv and carton (20)

Managing Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewManaging Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's View
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
 
FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
perlall
perlallperlall
perlall
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)
 
PRoot improved kernel compatibility
PRoot improved kernel compatibilityPRoot improved kernel compatibility
PRoot improved kernel compatibility
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
Carton
CartonCarton
Carton
 
Divorcing System
Divorcing SystemDivorcing System
Divorcing System
 
Perl
PerlPerl
Perl
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
Perl 20tips
Perl 20tipsPerl 20tips
Perl 20tips
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
packaging
packagingpackaging
packaging
 

More from Jose Luis Martínez

More from Jose Luis Martínez (10)

Being cloudy with perl
Being cloudy with perlBeing cloudy with perl
Being cloudy with perl
 
Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)
 
Escribir plugins para Nagios en Perl
Escribir plugins para Nagios en PerlEscribir plugins para Nagios en Perl
Escribir plugins para Nagios en Perl
 
NRD: Nagios Result Distributor
NRD: Nagios Result DistributorNRD: Nagios Result Distributor
NRD: Nagios Result Distributor
 
Perl and AWS
Perl and AWSPerl and AWS
Perl and AWS
 
Writing nagios plugins in perl
Writing nagios plugins in perlWriting nagios plugins in perl
Writing nagios plugins in perl
 
Ficheros y directorios
Ficheros y directoriosFicheros y directorios
Ficheros y directorios
 
DBI
DBIDBI
DBI
 
The modern perl toolchain
The modern perl toolchainThe modern perl toolchain
The modern perl toolchain
 
Introducción a las Expresiones Regulares
Introducción a las Expresiones RegularesIntroducción a las Expresiones Regulares
Introducción a las Expresiones Regulares
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Plenv and carton

  • 1. Set yourself free from the system: managing non-system Perls Jose Luis Martínez Torres JLMARTIN Barcelona Perl Workshop 2014 @pplu_io
  • 2. System perl  Debian  squeeze: 5.10  wheezy: 5.14  jessie: 5.20  Redhat  RHEL5: 5.8  RHEL6: 5.10  RHEL7: 5.16
  • 3. The distribution perl is not what you think it is For Debian Perl 5.14 $ /usr/bin/perl -V | grep DEBPKG | wc -l 57
  • 4. The distribution perl is not what you think it is http://perlbuzz.com/2008/08/red-hats-patch-slows-down-overloading-in-perl. html Some investigation revealed that there’s a long standing bug in Redhat Perl that causes *severe* performance degradation on code that uses the bless/overload combo. The thread on this is here: https://bugzilla.redhat.com/show_bug.cgi?id=379791
  • 5. The distribution perl is not what you think it is http://perlbuzz.com/2008/08/red-hats-patch-slows-down-overloading-in-perl. html Some investigation revealed that there’s a long standing bug in Redhat Perl that causes *severe* performance degradation on code that uses the bless/overload combo. The thread on this is here: https://bugzilla.redhat.com/show_bug.cgi?id=379791
  • 6. Compile my own perl? Hard??? In the olden days it could be a challenge
  • 7. Compile my own perl: Now No need for root! You only need compiler (and libs) apt-get install build-essential Now you choose: perlbrew / plenv I’ll use plenv today… (like it more)
  • 8. Plenv to the rescue https://github.com/tokuhirom/plenv/ git clone git://github.com/tokuhirom/plenv.git ~/.plenv echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.profile echo 'eval "$(plenv init -)"' >> ~/.profile exec $SHELL –l git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/ plenv install 5.20.1 # wait for it… plenv rehash plenv install-cpanm
  • 9. A Word of Caution #!/usr/bin/perl is soooooooooooo 2010… #!/usr/bin/env perl is the new #!/usr/bin/perl It’ll help your programs find the correct perl!
  • 10. Switching perls (At the directory level) plenv global 5.16.2 cd project1 plenv local 5.14.0 ./my_project
  • 11. My Modules! carton to the rescue
  • 12. Carton cpanm Carton vi cpanfile requires ‘Module1’; requires ‘Module2’; carton install # Magic happens… All modules get installed # Also generates a cpanfile.snapshot with all modules and versions installed carton exec ./my_project
  • 13. Trick carton exec $SHELL –l #Perl will find your modules without invoking carton
  • 15. Handling failures  Look at the log  Normally some headers missing DBD::mysql requires libmysqlclient-dev to be installed (Debian/Ubuntu) SSL related modules usually require OpenSSL: libssl-dev (Debian/Ubuntu) Some XML related modules require libexpat1-dev libxml2-dev Find a missing .h file in the compiler errors, and find which package it belongs to Rinse and Repeat “carton install”
  • 16. BUNDLE!!! carton bundle - Look at your vendor/cache dir! - Look at vendor/bin! ./vendor/bin/carton (fat packed version) I personally add the vendor directory to version control Smells like we get repeatable 
  • 17. DEPLOY!!! carton install # install all modules that don’t meet cpanfile requirements carton install --deployment # installs all versions from cpanfile.snapshot carton install --deployment --cached # installs versions from the vendor/cache
  • 18. Conclusions  plenv controls your Perl version  carton controls your dependencies  Enables  Repeatablility  Independant interpreters for different needs (think of microservices)  Testing new versions  Using up-to-date modules with no fear of CPAN breakage
  • 19. Thanks Tokuhiro Matsuno for plenv Tatsuhiko Miyagawa for carton