Slide 1

Slide 1 text

Perl 5.16 for the working programmer

Slide 2

Slide 2 text

Perl 5 what's new?

Slide 3

Slide 3 text

Perl 5.10 for people who are not totally insane

Slide 4

Slide 4 text

Perl 5.12 for everyday use

Slide 5

Slide 5 text

Perl 5.14 for pragmatists

Slide 6

Slide 6 text

Perl 5.16 for the working programmer

Slide 7

Slide 7 text

Lexical Semantics!

Slide 8

Slide 8 text

use feature ‘say’; say “This is a test!”; { no feature ‘say’; say “This is fatal!”; }

Slide 9

Slide 9 text

use 5.16.0; say “This is a test!”; { no feature ‘say’; say “This is fatal!”; }

Slide 10

Slide 10 text

#!/usr/bin/perl use strict; use warnings; use 5.16.0; # use feature ‘:5.16’; my $x = Reticulator->new; $x->reticulate(@splines);

Slide 11

Slide 11 text

#!/usr/bin/perl use strict; use warnings; # no feature; my $x = Reticulator->new; $x->reticulate(@splines);

Slide 12

Slide 12 text

#!/usr/bin/perl use strict; use warnings; # use feature ‘:default’ my $x = Reticulator->new; $x->reticulate(@splines);

Slide 13

Slide 13 text

array_base: $[

Slide 14

Slide 14 text

Cool New Features!

Slide 15

Slide 15 text

perldiag $str = “Greetings, $name. Your last login was $last. It is now $time.”; Better Error Message(s)

Slide 16

Slide 16 text

perldiag $str = “Greetings, $name. Your last login was $last. It is now $time.”; Better Error Message(s) Use of uninitialized value in concatenation (.) or string at hello.plx line 9.

Slide 17

Slide 17 text

perldiag Better Error Message(s) Use of uninitialized value $time in concatenation (.) or string at hello.plx line 9. $str = “Greetings, $name. Your last login was $last. It is now $time.”;

Slide 18

Slide 18 text

perlsub my $LINES_READ = 0; sub read_line { $LINES_READ++; ... } State Variables

Slide 19

Slide 19 text

perlsub { my $LINES_READ = 0; sub read_line { $LINES_READ++; ... } } State Variables

Slide 20

Slide 20 text

perlsub sub read_line { state $LINES_READ = 0; $LINES_READ++; ... } State Variables

Slide 21

Slide 21 text

perlop truth and definedness

Slide 22

Slide 22 text

perlop truth and definedness sub record_sale {

Slide 23

Slide 23 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_;

Slide 24

Slide 24 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount

Slide 25

Slide 25 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount || $product->price;

Slide 26

Slide 26 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount || $product->price; ...

Slide 27

Slide 27 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount || $product->price; ... }

Slide 28

Slide 28 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; $price = defined $amount ? $amount : $product->price; ... }

Slide 29

Slide 29 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount || $product->price; ... }

Slide 30

Slide 30 text

perlop truth and definedness sub record_sale { my ($product, $amount) = @_; my $price = $amount // $product->price; ... }

Slide 31

Slide 31 text

perlop the new OR operator sub record_sale { my ($product, $amount) = @_; $amount //= $product->cost; ... }

Slide 32

Slide 32 text

perlfunc - new built-in, say - it’s like print - but it adds a newline for you say $what

Slide 33

Slide 33 text

perlfunc say $what

Slide 34

Slide 34 text

perlfunc say $what print “Hello, world!\n”;

Slide 35

Slide 35 text

perlfunc say $what print “Hello, world!\n”; print “$message\n”;

Slide 36

Slide 36 text

perlfunc say $what print “Hello, world!\n”; print “$message\n”; print “$_\n” for @lines;

Slide 37

Slide 37 text

perlfunc say $what print “Hello, world!\n”; print “$message\n”; print “$_\n” for @lines; say “Hello, world!”;

Slide 38

Slide 38 text

perlfunc say $what print “Hello, world!\n”; print “$message\n”; print “$_\n” for @lines; say “Hello, world!”; say $message;

Slide 39

Slide 39 text

perlfunc say $what print “Hello, world!\n”; print “$message\n”; print “$_\n” for @lines; say “Hello, world!”; say $message; say for @lines;

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

$ perl -e ‘print “Foo\n”’

Slide 42

Slide 42 text

$ perl -e ‘print “Foo\n”’ $ perl -E ‘say “Foo”’

Slide 43

Slide 43 text

sub fact { my ($x) = @_; # must be +int return $x if $x == 1; return $x * fact($x - 1); } Recursion!

Slide 44

Slide 44 text

sub fact { my ($x) = @_; # must be +int return $x if $x == 1; return $x * fact($x - 1); } Recursion!

Slide 45

Slide 45 text

my $fact = sub { my ($x) = @_; # must be +int return $x if $x == 1; return $x * $fact->($x - 1); }; Recursion!

Slide 46

Slide 46 text

my $fact = sub { my ($x) = @_; # must be +int return $x if $x == 1; return $x * $fact->($x - 1); }; Recursion!

Slide 47

Slide 47 text

my $fact; $fact = sub { my ($x) = @_; # must be +int return $x if $x == 1; return $x * $fact->($x - 1); }; Recursion!

Slide 48

Slide 48 text

my $fact; $fact = sub { my ($x) = @_; # must be +int return $x if $x == 1; return $x * $fact->($x - 1); }; Recursion!

Slide 49

Slide 49 text

use Scalar::Util qw(weaken); my $fact = do { my $f1; my $f2 = $f1 = sub { my ($x) = @_; return $x if $x == 1; return $x * $f1->($x - 1); }; weaken($f1); $f1; }; Recursion!

Slide 50

Slide 50 text

use 5.16.0; # current_sub my $fact = sub { my ($x) = @_; # must be +int return $x if $x == 1; return $x * __SUB__->($x - 1); }; Recursion!

Slide 51

Slide 51 text

Filehandles!

Slide 52

Slide 52 text

autodie autodie open my $fh, ‘<‘, $filename; while (<$fh>) { ... } close $fh;

Slide 53

Slide 53 text

autodie autodie open my $fh, ‘<‘, $filename or die “couldn’t open $filename: $!”; while (<$fh>) { ... } close $fh or die “couldn’t close $filename: $!”;

Slide 54

Slide 54 text

autodie autodie use autodie; open my $fh, ‘<‘, $filename; while (<$fh>) { ... } close $fh;

Slide 55

Slide 55 text

autodie autodie use autodie; open my $fh, ‘<‘, $filename; while (<$fh>) { no autodie; rmdir or warn “couldn’t remove $_: $!”; } close $fh;

Slide 56

Slide 56 text

autodie autodie use autodie; sub foo { my $filename = shift; open my $fh, ‘<‘, $filename; while (<$fh>) { ... } } # this implicit close DID NOT AUTODIE

Slide 57

Slide 57 text

perlopentut IO::File sub stream_to_fh { my ($self, $fh) = @_; fileno $fh or die “can’t stream to closed fh”; while (my $hunk = $self->next_hunk) { print {$fh} $hunk; } close $fh or die “error closing: $!”; }

Slide 58

Slide 58 text

perlopentut IO::File sub stream_to_fh { my ($self, $fh) = @_; $fh->fileno or die “can’t stream to closed fh”; while (my $hunk = $self->next_hunk) { $fh->print($hunk); } $fh->close or die “error closing: $!”; }

Slide 59

Slide 59 text

perlopentut IO::File sub stream_to_fh { ... $fh->print($hunk); ... $fh->close or die “error closing: $!”; } open my $target, ‘>’, ‘/dev/null’ or die “can’t open bit bucket: $!”; stream_to_fh($target);

Slide 60

Slide 60 text

perlopentut IO::File use IO::File; sub stream_to_fh { ... $fh->print($hunk); ... $fh->close or die “error closing: $!”; } open my $target, ‘>’, ‘/dev/null’ or die “can’t open bit bucket: $!”; stream_to_fh($target);

Slide 61

Slide 61 text

perlopentut IO::File use 5.14.0; sub stream_to_fh { ... $fh->print($hunk); ... $fh->close or die “error closing: $!”; } open my $target, ‘>’, ‘/dev/null’ or die “can’t open bit bucket: $!”; stream_to_fh($target);

Slide 62

Slide 62 text

perlopentut IO::File use 5.14.0; use autodie; sub stream_to_fh { ... $fh->print($hunk); ... $fh->close or die “error closing: $!”; } open my $target, ‘>’, ‘/dev/null’ or die “can’t open bit bucket: $!”; stream_to_fh($target);

Slide 63

Slide 63 text

perlfunc Package Blocks package Library::Awesome; our $VERSION = 1.234; sub foo { ... } 1;

Slide 64

Slide 64 text

perlfunc Package Blocks use 5.12.0; package Library::Awesome 1.234; sub foo { ... } 1;

Slide 65

Slide 65 text

perlfunc Package Blocks use 5.12.0; package Library::Awesome 1.234-alpha; sub foo { ... } 1;

Slide 66

Slide 66 text

perlfunc Package Blocks package Library::Awesome 1.234 { sub foo { ... } } 1;

Slide 67

Slide 67 text

perldoc overloading - the -x overload - the qr overload - "no overloading" - unknown overload warns

Slide 68

Slide 68 text

Other New Features!

Slide 69

Slide 69 text

smrt match

Slide 70

Slide 70 text

if ($x ~~ $y) { ... } smrt match

Slide 71

Slide 71 text

perldoc smrt match

Slide 72

Slide 72 text

perldoc smrt match - if $x and $y are unknown, there are 23 possible dispatch paths

Slide 73

Slide 73 text

perldoc smrt match - if $x and $y are unknown, there are 23 possible dispatch paths - and some of them redispatch recursively

Slide 74

Slide 74 text

perldoc smrt match - if $x and $y are unknown, there are 23 possible dispatch paths - and some of them redispatch recursively - no, you won't remember them all

Slide 75

Slide 75 text

perldoc smrt match - if $x and $y are unknown, there are 23 possible dispatch paths - and some of them redispatch recursively - no, you won't remember them all - ...and they can't be intuited

Slide 76

Slide 76 text

Matching

Slide 77

Slide 77 text

if ($x ~~ $y) {...} Matching

Slide 78

Slide 78 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} Matching

Slide 79

Slide 79 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} if ($str ~~ @arr) {...} Matching

Slide 80

Slide 80 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} if ($str ~~ @arr) {...} if ($str ~~ [ \%h, ...]) {...} Matching

Slide 81

Slide 81 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} if ($str ~~ @arr) {...} if ($str ~~ [ \%h, ...]) {...} if (%hash ~~ %h) {...} Matching

Slide 82

Slide 82 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} if ($str ~~ @arr) {...} if ($str ~~ [ \%h, ...]) {...} if (%hash ~~ %h) {...} if (%hash ~~ @arr) {...} Matching

Slide 83

Slide 83 text

if ($x ~~ $y) {...} if ($str ~~ %hash) {...} if ($str ~~ @arr) {...} if ($str ~~ [ \%h, ...]) {...} if (%hash ~~ %h) {...} if (%hash ~~ @arr) {...} if (%hash ~~ [ \%h,...]) {...} Matching

Slide 84

Slide 84 text

given ($x) { when ($y) { ... } when ($z) { ... } }

Slide 85

Slide 85 text

given ($x) { when ($y) { try { ... } catch { warn “error: $_”; return undef; } } }

Slide 86

Slide 86 text

each @array

Slide 87

Slide 87 text

while (my ($i, $v) = each @array) { say “$i: $v”; } each @array

Slide 88

Slide 88 text

push $aref, @etc;

Slide 89

Slide 89 text

Now With Fewer Bugs!

Slide 90

Slide 90 text

y2038

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

~$ perl5.10.0 -E ‘say scalar localtime 2**31-1’

Slide 93

Slide 93 text

~$ perl5.10.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038

Slide 94

Slide 94 text

~$ perl5.10.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038 ~$ perl5.10.0 -E ‘say scalar localtime 2**31’

Slide 95

Slide 95 text

~$ perl5.10.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038 ~$ perl5.10.0 -E ‘say scalar localtime 2**31’ Fri Dec 13 15:45:52 1901

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

~$ perl5.12.0 -E ‘say scalar localtime 2**31-1’

Slide 98

Slide 98 text

~$ perl5.12.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038

Slide 99

Slide 99 text

~$ perl5.12.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038 ~$ perl5.12.0 -E ‘say scalar localtime 2**31’

Slide 100

Slide 100 text

~$ perl5.12.0 -E ‘say scalar localtime 2**31-1’ Mon Jan 18 22:14:07 2038 ~$ perl5.12.0 -E ‘say scalar localtime 2**31’ Mon Jan 18 22:14:08 2038

Slide 101

Slide 101 text

perlvar $@

Slide 102

Slide 102 text

Try::Tiny $@

Slide 103

Slide 103 text

Try::Tiny $@ - Well, actually, you use Try::Tiny, right?

Slide 104

Slide 104 text

Try::Tiny $@ - Well, actually, you use Try::Tiny, right? - But this makes Try::Tiny more reliable, too!

Slide 105

Slide 105 text

Try::Tiny $@ - Well, actually, you use Try::Tiny, right? - But this makes Try::Tiny more reliable, too! - You see, eval and $@ are totally awful

Slide 106

Slide 106 text

perlfunc use 5.12.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”;

Slide 107

Slide 107 text

perlfunc use 5.12.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; $ perl5.12.4 test.pl ERROR:

Slide 108

Slide 108 text

perlfunc use 5.14.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”;

Slide 109

Slide 109 text

perlfunc use 5.14.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; $ perl5.14.1 test.pl ERROR: DEATH!!

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

perl -le ‘print $^X’

Slide 112

Slide 112 text

perl -le ‘print $^X’ 10.0: perl

Slide 113

Slide 113 text

perl -le ‘print $^X’ 10.0: perl 10.1: perl

Slide 114

Slide 114 text

perl -le ‘print $^X’ 10.0: perl 10.1: perl 12.0: perl

Slide 115

Slide 115 text

perl -le ‘print $^X’ 10.0: perl 10.1: perl 12.0: perl 14.0: perl

Slide 116

Slide 116 text

perl -le ‘print $^X’ 10.0: perl 10.1: perl 12.0: perl 14.0: perl 16.0: /Users/rjbs/perl5/perlbrew/perls/16.0/bin/perl

Slide 117

Slide 117 text

Simpler Strings

Slide 118

Slide 118 text

perlunicode Perl is Good at Unicode

Slide 119

Slide 119 text

perlunicode Perl 5.16 is Better

Slide 120

Slide 120 text

perlunicode Perl 5.16 is Better - Unicode 6.1

Slide 121

Slide 121 text

perlunicode Perl 5.16 is Better - Unicode 6.1 - every character property is available

Slide 122

Slide 122 text

perlunicode Perl 5.16 is Better - Unicode 6.1 - every character property is available - \X in regex is more sensible

Slide 123

Slide 123 text

perlunicode “The Unicode Bug”

Slide 124

Slide 124 text

perlunicode “The Unicode Bug” - strings aren’t always treated as Unicode

Slide 125

Slide 125 text

perlunicode “The Unicode Bug” - strings aren’t always treated as Unicode - this causes weird bugs that take ages to find

Slide 126

Slide 126 text

perlunicode “The Unicode Bug” - strings aren’t always treated as Unicode - this causes weird bugs that take ages to find - use feature ‘unicode_strings’;

Slide 127

Slide 127 text

perlunicode “The Unicode Bug” - strings aren’t always treated as Unicode - this causes weird bugs that take ages to find - use feature ‘unicode_strings’; - or use 5.12.0

Slide 128

Slide 128 text

perldoc Unicode eval - eval $str - is that octets or chars? - what if it includes "use utf8" - or you're under "use utf8"?

Slide 129

Slide 129 text

perldoc Unicode eval - evalbytes $str - unicode_eval

Slide 130

Slide 130 text

perldiag My Favorite 5.12-ism? if (length $input->{new_email}) { $user->update_email(...); }

Slide 131

Slide 131 text

perldiag My Favorite 5.12-ism? Use of uninitialized value in length at - line 3120. if (length $input->{new_email}) { $user->update_email(...); }

Slide 132

Slide 132 text

perldiag My Favorite 5.12-ism? if (length $input->{new_email}) { $user->update_email(...); }

Slide 133

Slide 133 text

perlsyn say “I \o{23145} Perl 5.14!”;

Slide 134

Slide 134 text

perlsyn say “I \o{23145} Perl 5.14!”; I — Perl 5.14!

Slide 135

Slide 135 text

perlsyn say “I \23145 Perl 5.14!”; I ?45 Perl 5.14!

Slide 136

Slide 136 text

perlsyn say “I \023145 Perl 5.14!”; I 145 Perl 5.14!

Slide 137

Slide 137 text

perlre qr{ (1) (2) (3) (4) \7 \10 (5) (6) (7) (8) (9) \7 \10 (10) \7 \10 }x;

Slide 138

Slide 138 text

perlre qr{ (1) (2) (3) (4) \o{7} \o{10} (5) (6) (7) (8) (9) \o{7} \o{10} (10) \g{7} \g{10} }x;

Slide 139

Slide 139 text

charnames Unicode 6.1

Slide 140

Slide 140 text

charnames Unicode 6.1

Slide 141

Slide 141 text

charnames Unicode 6

Slide 142

Slide 142 text

charnames Unicode 6

Slide 143

Slide 143 text

charnames Unicode 6

Slide 144

Slide 144 text

charnames Unicode 6

Slide 145

Slide 145 text

charnames Unicode 6

Slide 146

Slide 146 text

charnames Unicode 6

Slide 147

Slide 147 text

charnames Unicode 6

Slide 148

Slide 148 text

charnames Unicode 6

Slide 149

Slide 149 text

charnames Unicode 6

Slide 150

Slide 150 text

use 5.16.0; say “I \N{HEAVY BLACK HEART} Queensr” . “\N{LATIN SMALL LETTER Y WITH DIAERESIS}” . “che!”; \N{...}

Slide 151

Slide 151 text

case folding

Slide 152

Slide 152 text

if (lc $foo eq lc $bar) { ... } Case Folding

Slide 153

Slide 153 text

if (fc $foo eq fc $bar) { ... } Case Folding

Slide 154

Slide 154 text

Case Folding

Slide 155

Slide 155 text

lc ‘ς‘ ➔ ‘ς‘ Case Folding

Slide 156

Slide 156 text

lc ‘ς‘ ➔ ‘ς‘ uc ‘ς‘ ➔ ‘Σ‘ Case Folding

Slide 157

Slide 157 text

lc ‘ς‘ ➔ ‘ς‘ uc ‘ς‘ ➔ ‘Σ‘ fc ‘ς‘ ➔ ‘σ‘ Case Folding

Slide 158

Slide 158 text

lc ‘ς‘ ➔ ‘ς‘ uc ‘ς‘ ➔ ‘Σ‘ fc ‘ς‘ ➔ ‘σ‘ lc ‘ß’ ➔ ‘ß’ Case Folding

Slide 159

Slide 159 text

lc ‘ς‘ ➔ ‘ς‘ uc ‘ς‘ ➔ ‘Σ‘ fc ‘ς‘ ➔ ‘σ‘ lc ‘ß’ ➔ ‘ß’ uc ‘ß’ ➔ ‘SS’ Case Folding

Slide 160

Slide 160 text

lc ‘ς‘ ➔ ‘ς‘ uc ‘ς‘ ➔ ‘Σ‘ fc ‘ς‘ ➔ ‘σ‘ lc ‘ß’ ➔ ‘ß’ uc ‘ß’ ➔ ‘SS’ fc ‘ß’ ➔ ‘ss’ Case Folding

Slide 161

Slide 161 text

Case Folding

Slide 162

Slide 162 text

“file under: \L$name” Case Folding

Slide 163

Slide 163 text

“file under: \L$name” “file under: \F$name” Case Folding

Slide 164

Slide 164 text

Better Regex

Slide 165

Slide 165 text

named captures

Slide 166

Slide 166 text

perlre Regex: Named Captures

Slide 167

Slide 167 text

perlre Regex: Named Captures - find matches by name, not position

Slide 168

Slide 168 text

perlre Regex: Named Captures - find matches by name, not position - avoid the dreaded $1

Slide 169

Slide 169 text

perlre Regex: Named Captures - find matches by name, not position - avoid the dreaded $1 - no longer second to Python or .Net!

Slide 170

Slide 170 text

perlre # our hypothetical format section:property = value Regex: Named Captures

Slide 171

Slide 171 text

perlre $line =~ /(\w+):(\w+) = (\w+)/; $section = $1 $name = $2; $value = $3; Regex: Named Captures

Slide 172

Slide 172 text

perlre Regex: Named Captures $line =~ / (? \w+): (? \w+) \s* = \s* (? \w+) /x; $section = $+{section}; $name = $+{name}; $value = $+{value};

Slide 173

Slide 173 text

perlre New Regex Modifiers my $hostname = get_hostname; $hostname =~ s/\..*//s;

Slide 174

Slide 174 text

perlre New Regex Modifiers my $hostname = get_hostname =~ s/\..*//s;

Slide 175

Slide 175 text

perlre New Regex Modifiers (my $hostname = get_hostname) =~ s/\..*//s;

Slide 176

Slide 176 text

perlre New Regex Modifiers my $hostname = get_hostname =~ s/\..*//sr;

Slide 177

Slide 177 text

perlre New Regex Modifiers my @short_names = map { s/\..*//s; } @long_names;

Slide 178

Slide 178 text

perlre New Regex Modifiers my @short_names = map { s/\..*//s; $_ } @long_names;

Slide 179

Slide 179 text

perlre New Regex Modifiers my @short_names = map { my $x = $_; $x =~ s/\..*//s; $x } @long_names;

Slide 180

Slide 180 text

perlre New Regex Modifiers my @short_names = map { s/\..*//sr } @long_names;

Slide 181

Slide 181 text

perlre New Regex Modifiers my @short_names = map s/\..*//sr, @long_names;

Slide 182

Slide 182 text

perldoc New Regex Modifiers

Slide 183

Slide 183 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 184

Slide 184 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 185

Slide 185 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 186

Slide 186 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 187

Slide 187 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 188

Slide 188 text

perldoc /u /a /aa /d /l "൮" =~ /\d/ ✓ ❌ ❌ ¿? ¿? "ð" =~ /\w/ ✓ ❌ ❌ ¿? ¿? "ff" =~ /ff/i ✓ ✓ ❌ ¿? ¿? "ff" =~ /pL/i ✓ ✓ ✓ ¿? ¿? New Regex Modifiers

Slide 189

Slide 189 text

perlre New Regex Modifiers # To be really ASCII-only: die “funny un-American characters” if $str =~ /\P{ASCII}/; $str =~ /...actual pattern.../;

Slide 190

Slide 190 text

study

Slide 191

Slide 191 text

my $re = qr{...complex...}; study

Slide 192

Slide 192 text

my $re = qr{...complex...}; my $str = q{...long complex...}; study

Slide 193

Slide 193 text

my $re = qr{...complex...}; my $str = q{...long complex...}; $str =~ $re; # slow!! study

Slide 194

Slide 194 text

my $re = qr{...complex...}; my $str = q{...long complex...}; $str =~ $re; # slow!! study $str; # does stuff study

Slide 195

Slide 195 text

my $re = qr{...complex...}; my $str = q{...long complex...}; $str =~ $re; # slow!! study $str; # does stuff $str =~ $re; # fast!! study

Slide 196

Slide 196 text

my $re = qr{...complex...}; my $str = q{...long complex...}; $str =~ $re; # slow but right!! study $str; # does stuff $str =~ $re; # who knows!! study

Slide 197

Slide 197 text

my $re = qr{...complex...}; my $str = q{...long complex...}; $str =~ $re; # slow but right!! study $str; # does nothing $str =~ $re; # slow but right!! study

Slide 198

Slide 198 text

Modder Modlib

Slide 199

Slide 199 text

perlmodlib Newly Cored Librarys - JSON - HTTP::Tiny - Module::Metadata - CPAN::Meta

Slide 200

Slide 200 text

perlmodlib Newly Ejected Librarys - Devel::DProf - Switch - the perl4 core - ...and more

Slide 201

Slide 201 text

Old Stuff Removed

Slide 202

Slide 202 text

perlop qw() for my $show qw(Smallville Lost V) { $tivo->cancel_pass( $show ); }

Slide 203

Slide 203 text

perlop qw() for my $show (qw(Smallville Lost V)) { $tivo->cancel_pass( $show ); }

Slide 204

Slide 204 text

$[

Slide 205

Slide 205 text

perlvar $[ - first index of array

Slide 206

Slide 206 text

perlvar $[ - first index of array - so you can make $array[1] mean first

Slide 207

Slide 207 text

perlvar $[ - first index of array - so you can make $array[1] mean first - isn’t that awesome???

Slide 208

Slide 208 text

perlvar $[ - first index of array - so you can make $array[1] mean first - isn’t that awesome??? - yeah, about as awesome as Comic Sans

Slide 209

Slide 209 text

perlvar $[ $[ = 1; for (1 .. $#array) { ... }

Slide 210

Slide 210 text

perlvar $[ for ($[ .. $#array) { ... }

Slide 211

Slide 211 text

perlvar $[ Assigned to $[. Are you some kind of idiot or something? at -e line 123.

Slide 212

Slide 212 text

perlvar $[ Use of assignment to $[ is deprecated at -e line 123.

Slide 213

Slide 213 text

defined @arr

Slide 214

Slide 214 text

Any questions?

Slide 215

Slide 215 text

Thank you!