modern perl for the unfrozen paleolithic perl programmer

Post on 20-Feb-2017

2.752 Views

Category:

Internet

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Modern Perl for the Unfrozen Paleolithic

Perl ProgrammerJohn SJ Anderson Infinity Interactive ⭐︎ ⭐ @︎genehack

Pittsburgh Perl Workshop 2015 11 Oct 2015 ⭐︎

I'M JUST A CAVEMAN

YOUR MODERN PERL FRIGHTENS AND CONFUSES ME

Welcome to

2015!

Quite a few things have changed...

...but many

haven't

You're just in time for the Perl6 release

party

We're still using Perl5!

2001: Perl 5.6

2015: Perl 5.22

Many language

improvements

Unicode support

!

😀

💩

defined($this) ? $this : $that

defined-or

$this // $that

defined-or

subroutine

signatures

sub add ($one, $two) { return $one + $two; }

new tools

"system" perl:

"system" perl:

just say no

/usr/bin/perl

/usr/bin/perl

perlbrew

perlbrew.pl

plenv

https://github.com/tokuhirom/plenv

advantages• Solves "vendor Perl lockin" issues

• Install multiple Perls in your home directory

• ... or elsewhere

• Trivially switch from Perl version to Perl version

• Able to install modules without special permissions

• Easy to stay up to date with Perl development

plenv > perlbrew• Less magic messing around with PATH

• Can "pin" Perl different ways: globally, per-shell, or per-directory

perlbrew > plenv• Kickass website

speaking of installing in your $HOME…

local::lib

local::lib• Install your own copies of modules

• In your $HOME (so no special permissions needed)

• Can also install per-project modules

• Integrates well with other tools

speaking of installing stuff…

cpanminus

cpanm

% cpan Git::WrapperCPAN: Storable loaded ok (v2.54)Reading '/Users/genehack/.cpan/Metadata' Database was generated on Sat, 10 Oct 2015 01:17:02 GMTRunning install for module 'Git::Wrapper'CPAN: LWP::UserAgent loaded ok (v6.13)Fetching with LWP:http://cpan.schatt.com/authors/id/G/GE/GENEHACK/Git-Wrapper-0.045.tar.gzCPAN: YAML loaded ok (v1.15)CPAN: Digest::SHA loaded ok (v5.95)Fetching with LWP:http://cpan.schatt.com/authors/id/G/GE/GENEHACK/CHECKSUMSCPAN: Compress::Zlib loaded ok (v2.068)Checksum for /Users/genehack/.cpan/sources/authors/id/G/GE/GENEHACK/Git-Wrapper-0.045.tar.gz oktmp-47326 for tmp-47326: No such file or directory at /opt/plenv/versions/5.23.2/lib/perl5/5.23.2/CPAN/Distribution.pm line 468.CPAN: File::Temp loaded ok (v0.2304)CPAN: CPAN::Meta::Requirements loaded ok (v2.133)CPAN: Parse::CPAN::Meta loaded ok (v1.4417)CPAN: CPAN::Meta loaded ok (v2.150005)CPAN: Module::CoreList loaded ok (v5.20150820)Configuring G/GE/GENEHACK/Git-Wrapper-0.045.tar.gz with Makefile.PLLocating bin:git... found at /opt/git/bin/git.Checking if your kit is complete...Looks goodGenerating a Unix-style MakefileWriting Makefile for Git::WrapperWriting MYMETA.yml and MYMETA.json

GENEHACK/Git-Wrapper-0.045.tar.gz [17/1516] /opt/plenv/versions/5.23.2/bin/perl5.23.2 Makefile.PL -- OKRunning make for G/GE/GENEHACK/Git-Wrapper-0.045.tar.gzcp lib/Git/Wrapper/File/RawModification.pm blib/lib/Git/Wrapper/File/RawModification.pmcp lib/Git/Wrapper.pm blib/lib/Git/Wrapper.pmcp lib/Git/Wrapper/Statuses.pm blib/lib/Git/Wrapper/Statuses.pmcp lib/Git/Wrapper/Exception.pm blib/lib/Git/Wrapper/Exception.pmcp lib/Git/Wrapper/Log.pm blib/lib/Git/Wrapper/Log.pmcp lib/Git/Wrapper/Status.pm blib/lib/Git/Wrapper/Status.pmManifying 6 pod documents GENEHACK/Git-Wrapper-0.045.tar.gz /usr/bin/make -- OKRunning make testPERL_DL_NONLAZY=1 "/opt/plenv/versions/5.23.2/bin/perl5.23.2" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.tt/00-load.t ............... 1/6 # Testing Git::Wrapper 0.045t/00-load.t ............... okt/author-err.t ............ skipped: these tests are for testing by the authort/basic.t ................. # Testing git version: 2.5.2t/basic.t ................. okt/git_binary.t ............ okt/parse_args.t ............ okt/path_class.t ............ # Testing git version: 2.5.2t/path_class.t ............ okt/release-pod-coverage.t .. skipped: these tests are for release candidate testingt/release-pod-syntax.t .... skipped: these tests are for release candidate testingAll tests successful.Files=8, Tests=67, 1 wallclock secs ( 0.04 usr 0.02 sys + 0.39 cusr 0.31 csys = 0.76 CPU)Result: PASS GENEHACK/Git-Wrapper-0.045.tar.gz

(still not done but I got tired of pasting.)

% cpanm Git::Wrapper--> Working on Git::WrapperFetching http://www.cpan.org/authors/id/G/GE/GENEHACK/Git-Wrapper-0.045.tar.gz ... OKConfiguring Git-Wrapper-0.045 ... OKBuilding and testing Git-Wrapper-0.045 ... OKSuccessfully installed Git-Wrapper-0.045

speaking of stuff on CPAN…

https://metacpan.org/

search.cpan.org

https://metacpan.org/

https://metacpan.org/

https://github.com/CPAN-API/metacpan-web

Duck Duck Go

Duck Duck Go

!cpanm

speaking of modules...

JSON::MaybeXS

MooseMoo

CGI.pmis

gone

(not really)

Plack

speaking of Perl websites…

http://cpanratings.perl.org/

http://cpanratings.perl.org/

https://metacpan.org/

http://cpants.cpanauthors.org/

http://cpants.cpanauthors.org/

https://metacpan.org/

http://prepan.org/

speaking of staying up to date on Perl news…

http://perlweekly.com/

http://blogs.perl.org/users/sawyer_x/

speaking of retrospectives

thanks!

questions?

top related