Perl 5.22 and You

Perl 5.22 and You

Cec6b9b88295ead26c65f8747a76561b?s=128

Ricardo Signes

June 18, 2015
Tweet

Transcript

  1. Perl 5.22 your highly syntactic programming pal

  2. 5.x

  3. 5.x •every year a new stable perl 5

  4. 5.x •every year a new stable perl 5 •each one

    better* than the last
  5. 5.x •every year a new stable perl 5 •each one

    better* than the last •every month a new dev perl 5
  6. 5.x •every year a new stable perl 5 •each one

    better* than the last •every month a new dev perl 5 •each one different than the last
  7. 5.x •every year a new stable perl 5 •each one

    better* than the last •every month a new dev perl 5 •each one different than the last * says me
  8. Code Ejection

  9. Code Ejection delete the old crazy stuff

  10. Code Ejection delete the old crazy stuff (to make room

    for the new crazy stuff)
  11. sigilless style

  12. sigilless style push @array, 1, 2, 3, 4;

  13. sigilless style push @array, 1, 2, 3, 4; for (keys

    %hash) { ... }
  14. sigilless style push @array, 1, 2, 3, 4; for (keys

    %hash) { ... }
  15. sigilless style push @array, 1, 2, 3, 4; for (keys

    %hash) { ... } push array, 1, 2, 3, 4;
  16. sigilless style push @array, 1, 2, 3, 4; for (keys

    %hash) { ... } push array, 1, 2, 3, 4; for (keys hash) { ... }
  17. sigilless style push @array, 1, 2, 3, 4; for (keys

    %hash) { ... } push array, 1, 2, 3, 4; for (keys hash) { ... }
  18. hash refauxrence

  19. hash refauxrence my $value = $hash{key};

  20. hash refauxrence my $value = $hash{key}; $hash{key} = $new;

  21. hash refauxrence my $value = $hash{key}; $hash{key} = $new;

  22. hash refauxrence my $value = $hash{key}; $hash{key} = $new; my

    $value = %hash->{key};
  23. hash refauxrence my $value = $hash{key}; $hash{key} = $new; my

    $value = %hash->{key}; %hash->{key} = $new;
  24. hash refauxrence my $value = $hash{key}; $hash{key} = $new; my

    $value = %hash->{key}; %hash->{key} = $new;
  25. ?regex?

  26. ?regex? for (1..10) { say if /./ }

  27. ?regex? for (1..10) { say if /./ } for (1..10)

    { say if ?.? }
  28. ?regex? for (1..10) { say if /./ } for (1..10)

    { say if ?.? }
  29. ?regex? for (1..10) { say if /./ } for (1..10)

    { say if ?.? } for (1..10) { say if m?.? }
  30. collection definedness

  31. collection definedness if (defined @array) { ... }

  32. collection definedness if (defined @array) { ... }

  33. collection definedness if (defined @array) { ... } if (defined

    %hash) { ... }
  34. collection definedness if (defined @array) { ... } if (defined

    %hash) { ... }
  35. "\cX" "\c@" "\c " "\c牃" "\c¿"

  36. "\cX" "\c@" "\c " "\c牃" "\c¿" "\cX" ==> CANCEL

  37. "\cX" "\c@" "\c " "\c牃" "\c¿" "\cX" ==> CANCEL "\c@"

    ==> NUL
  38. "\cX" "\c@" "\c " "\c牃" "\c¿" "\cX" ==> CANCEL "\c@"

    ==> NUL "\c " ==> GRAVE ACCENT
  39. "\cX" "\c@" "\c " "\c牃" "\c¿" "\cX" ==> CANCEL "\c@"

    ==> NUL "\c " ==> GRAVE ACCENT "\c牃" ==> LATIN CAPITAL LETTER X
  40. "\cX" "\c@" "\c " "\c牃" "\c¿" "\cX" ==> CANCEL "\c@"

    ==> NUL "\c " ==> GRAVE ACCENT "\c牃" ==> LATIN CAPITAL LETTER X "\c¿" ==> Hmmm…
  41. ~$ perl -de0 Loading DB routines from perl5db.pl version 1.28

    Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1>
  42. ~$ perl -de0 Loading DB routines from perl5db.pl version 1.28

    Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> x "\c¿"
  43. ~$ perl -de0 Loading DB routines from perl5db.pl version 1.28

    Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> x "\c¿" 0 '??'
  44. None
  45. DB<1> $str = q{"\c}

  46. DB<1> $str = q{"\c} . chr(0xBF)

  47. DB<1> $str = q{"\c} . chr(0xBF) That's ¿

  48. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; That's ¿

  49. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; That's ¿
  50. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; DB<3> x $res That's ¿
  51. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; DB<3> x $res 0 '?' That's ¿
  52. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; DB<3> x $res 0 '?' That's ¿
  53. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; DB<3> x $res 0 '?' DB<4> x ord $res That's ¿
  54. DB<1> $str = q{"\c} . chr(0xBF) . q{"}; DB<2> $res

    = eval $str; DB<3> x $res 0 '?' DB<4> x ord $res 0 255 That's ¿
  55. None
  56. say "\c¿";

  57. say "\c¿";

  58. say "\c¿"; FATAL!! Must be printable ASCII!

  59. say $^H; # <-- private compile-time hints

  60. say $^H; # <-- private compile-time hints say ; #

    <-- private compile-time hints
  61. say $^H; # <-- private compile-time hints say ; #

    <-- private compile-time hints say $爳; # <-- private compile-time hints
  62. $^K ==

  63. $VT $^K ==

  64. UNIVERSAL exports use UNIVERSAL;

  65. UNIVERSAL exports use UNIVERSAL 'isa';

  66. good bye, old modules

  67. Module::Build

  68. CGI.pm

  69. you will be missed

  70. you will be missed remembered

  71. you will be missed remembered available on CPAN

  72. good bye, jerkiness

  73. p5p standards of conduct

  74. p5p conduct •be civil •if you can't be civil, you

    will be escorted out of the building
  75. okay, but what's new in Perl??

  76. filehandles

  77. (<>) while (<>) { print if /awesome/; }

  78. (<>) while (<>) { print if /awesome/; } $ some-thing

    | your-program
  79. (<>) while (<>) { print if /awesome/; } $ some-thing

    | your-program $ your-program xyz.txt abc.txt
  80. (<>) while (<>) { print if /awesome/; } while ($ARGV

    = shift) { open(ARGV, $ARGV); while (<ARGV>) { ... } }
  81. (<>) while (<>) { print if /awesome/; } while ($ARGV

    = shift) { open(ARGV, $ARGV); while (<ARGV>) { ... } }
  82. (<>) while (<>) { print if /awesome/; } $ some-thing

    | your-program $ your-program xyz.txt abc.txt
  83. (<>) while (<>) { print if /awesome/; } $ your-program

    xyz.txt 'rm -rfv *|' $ some-thing | your-program $ your-program xyz.txt abc.txt
  84. (<<>>) while (<<>>) { print if /awesome/; } $ your-program

    xyz.txt abc.txt $ some-thing | your-program $ your-program xyz.txt 'rm -rfv *|'
  85. open -| open my $fh, "-|", "program", @args;

  86. implicit close open my $fh, '>', 'output.txt'; print { $fh

    } $_ for @results;
  87. implicit close { open my $fh, '>', 'output.txt'; print {

    $fh } $_ for @results; }
  88. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # $fh is closed implicitly implicit close
  89. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # $fh is closed implicitly # but the disk is full implicit close
  90. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # $fh is closed implicitly # but the disk is full # so the close fails implicit close
  91. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # $fh is closed implicitly # but the disk is full # so the close fails # silently implicit close
  92. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # $fh is closed implicitly # but the disk is full # so the close fails # silently # :-( implicit close
  93. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # warning if close fails! implicit close
  94. { open my $fh, '>', 'output.txt'; print { $fh }

    $_ for @results; } # warning if close fails! # (...and you can fatalize it) implicit close
  95. { use warnings FATAL => 'io'; open my $fh, '>',

    'output.txt'; print { $fh } $_ for @results; } # warning if close fails! # (...and you can fatalize it) implicit close
  96. Regex Stuff

  97. establishing boundaries

  98. establishing boundaries \b

  99. establishing boundaries Don't think twice. It's all right. \b

  100. establishing boundaries Don't think twice. It's all right. \b

  101. establishing boundaries Don't think twice. It's all right. \b{w}

  102. establishing boundaries Don't think twice. It's all right. \b{w}

  103. establishing boundaries Don't think twice. It's all right. \b{w}

  104. establishing boundaries Don't think twice. It's all right. \b{sb}

  105. establishing boundaries Don't think twice. It's all right. \b{sb}

  106. establishing boundaries Don't think twice. It's all right. /(?!>^)\b{sb}/

  107. establishing boundaries Don't think twice. It's all right. \b{gcb}

  108. establishing boundaries Don't think twice. It's all right. \b{gcb}

  109. establishing boundaries Don't think twice. It's all right. split /\b{gcb}/

  110. establishing boundaries Don't think twice. It's all right. split //

  111. establishing boundaries Queensrÿche split //

  112. establishing boundaries Queensrÿche split //

  113. establishing boundaries Queensry¨che split //

  114. establishing boundaries Queensrÿche split /\b{gcb}/

  115. Avoid Capture

  116. Avoid Capture qr/v(?:[0-9]+)(?:(?:\.[0-9]+)+(?:_[0-9]+)?)?/;

  117. Avoid Capture

  118. Avoid Capture qr/v (?:[0-9]+)

  119. Avoid Capture qr/v (?:[0-9]+) (?: (?: \.[0-9]+ )+

  120. Avoid Capture qr/v (?:[0-9]+) (?: (?: \.[0-9]+ )+ (?: _

    [0-9]+ )? )?/x;
  121. Avoid Capture qr/v ( [0-9]+) ( ( \.[0-9]+ )+ (

    _ [0-9]+ )? )?/xn;
  122. Avoid Capture qr/v [0-9]+ ( ( \.[0-9]+ )+ ( _

    [0-9]+ )? )?/xn;
  123. Avoid Capture qr/v ( [0-9]+) ( ( \.[0-9]+ )+ (

    _ [0-9]+ )? )?/xn;
  124. Avoid Capture qr/v (?-n: [0-9]+ ) ( ( \.[0-9]+ )+

    (?-n: _ [0-9]+ )? )?/xn;
  125. Avoid Capture qr/v (?<major> [0-9]+ ) ( ( \.[0-9]+ )+

    (?<dev> _ [0-9]+ )? )?/xn; %vers = (major => $+{major}, dev => $+{dev});
  126. Avoid Capture qr/v (?<major> [0-9]+ ) ( ( \.[0-9]+ )+

    (?<dev> _ [0-9]+ )? )?/xn; %vers = %+{ qw(major dev) };
  127. Pair Slices (from v5.20.0)

  128. my @array = qw[ foo bar baz quux ]; my

    @slice = @array[ 1, 3 ]; # Now @slice is ("bar", "quux")
  129. my %hash = (a => 1, b => 2, c

    => 3); my @slice = @hash{ 'a', 'c' }; # Now @slice is (1, 3)
  130. my %hash = (a => 1, b => 2, c

    => 3); my %slice = %hash{ 'a', 'c' }; # Now %slice is (a => 1, c => 3)
  131. my %hash = (a => 1, b => 2, c

    => 3); my @slice = %hash{ 'a', 'd', 'a' }; # Now @slice is # (a => 1, d => undef, a => 1)
  132. my @array = qw[ foo bar baz quux ]; my

    @slice = %array[ 1, 3 ]; # @slice is (1 => "bar", 3 => "quux")
  133. my $record = { artist => $album{artist}, title => $album{title},

    tracks => $album{tracks}, year => $album{edition}{year}, label => $album{edition}{lable}, };
  134. my $record = { artist => $album{artist}, title => $album{title},

    tracks => $album{tracks}, year => $album{edition}{year}, label => $album{edition}{lable}, };
  135. my $record = { artist => $album{artist}, title => $album{title},

    tracks => $album{tracks}, year => $album{edition}{year}, label => $album{edition}{label}, };
  136. my $record = { %album{qw( artist title tracks )}, year

    => $album{edition}{year}, label => $album{edition}{label}, };
  137. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } };
  138. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1
  139. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1
  140. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1 @{ $hashref->{x} }->{ k1, k2 } #2
  141. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1 @{ $hashref->{x} }->{ k1, k2 } #2
  142. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1 @{ $hashref->{x} }->{ k1, k2 } #2 @{ $hashref->{x}{ k1, k2 } } #3
  143. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1 @{ $hashref->{x} }->{ k1, k2 } #2 @{ $hashref->{x}{ k1, k2 } } #3
  144. # Your mission: get a slice of values # from

    $hashref->{x} my $hashref = { x => { ... } }; $hashref->{x}{ k1, k2 } #1 @{ $hashref->{x} }->{ k1, k2 } #2 @{ $hashref->{x}{ k1, k2 } } #3 @{ $hashref->{x} }{ k1, k2} #4
  145. my $record = { %album{qw( artist title tracks )}, year

    => $album{edition}{year}, label => $album{edition}{label}, };
  146. my $record = { %album{qw( artist title tracks )}, $album->{edition}->%{

    qw(year label) } );
  147. Postfix Dereferencing (from v5.20.0)

  148. push $sess->{user}->logins , @{ $queue->{unflushed}->logins }; process(@{ $queue->{unhandled}->jobs }); map

    { $_ > $#{$in[0]} } @{$job->input}
  149. push $sess->{user}->logins->@* , @{ $queue->{unflushed}->logins }; process(@{ $queue->{unhandled}->jobs }); map

    { $_ > $#{$in[0]} } @{$job->input}
  150. push $sess->{user}->logins->@* , $queue->{unflushed}->logins->@*; process(@{ $queue->{unhandled}->jobs }); map { $_

    > $#{$in[0]} } @{$job->input}
  151. push $sess->{user}->logins->@* , $queue->{unflushed}->logins->@*; process($queue->{unhandled}->jobs->@*); map { $_ > $#{$in[0]}

    } @{$job->input}
  152. push $sess->{user}->logins->@* , $queue->{unflushed}->logins->@*; process($queue->{unhandled}->jobs->@*); map { $_ > $#{$in[0]}

    } $job->input->@*
  153. push $sess->{user}->logins->@* , $queue->{unflushed}->logins->@*; process($queue->{unhandled}->jobs->@*); map { $_ > $in[0]->$#*

    } $job->input->@*
  154. @{ expr } ⇢ ⇢ ⇢ ⇢ expr->@* %{ expr

    } ⇢ ⇢ ⇢ ⇢ expr->%* ${ expr } ⇢ ⇢ ⇢ ⇢ expr->$* &{ expr } ⇢ ⇢ ⇢ ⇢ expr->&* *{ expr } ⇢ ⇢ ⇢ ⇢ expr->** $#{ expr } ⇢ ⇢ ⇢ ⇢ expr->$#*
  155. @{ expr }[1,2,3] ⇢ expr->@[1,2,3] @{ expr }{k1,k2} ⇢ expr->@{k1,k2}

    %{ expr }[1,2,3] ⇢ expr->%[1,2,3] %{ expr }{k1,k2} ⇢ expr->%{k1,k2} *{ expr }{ARRAY} ⇢ expr->*{ARRAY}
  156. say "Items: $arrayref->@*[0,1]" say "Content: $body_ref->$*"

  157. Postfix Dereferencing (use experimental 'postderef')

  158. reference aliasing (from v5.22.0)

  159. None
  160. my @array = (1, 2, 3, 4);

  161. my @array = (1, 2, 3, 4); my $ref =

    \@array;
  162. my @array = (1, 2, 3, 4); my $ref =

    \@array;
  163. my @array = (1, 2, 3, 4); my $ref =

    \@array; shift @$ref;
  164. my @array = (1, 2, 3, 4); my $ref =

    \@array; shift @$ref;
  165. my @array = (1, 2, 3, 4); my $ref =

    \@array; shift @$ref; say "@array";
  166. my @array = (1, 2, 3, 4); my $ref =

    \@array; shift @$ref; say "@array";
  167. my @array = (1, 2, 3, 4); my $ref =

    \@array; shift @$ref; say "@array"; 2 3 4
  168. my @array = (1, 2, 3, 4); my @copy =

    @array; shift @copy; say "@array"; 1 2 3 4
  169. my @array = (1, 2, 3, 4); \my @alias =

    \@array; shift @alias; say "@array"; 2 3 4
  170. my @array = (1, 2, 3, 4); \my @alias =

    \@array; shift @alias; say "@array"; 2 3 4
  171. my @todo = ({ what => 'eat pie', when =>

    'right now' }, { what => 'eat cake', when => 'quite soon' }); for my $item (@todo) { say "Please $item->{what} $item->{when}." }
  172. my @todo = ({ what => 'eat pie', when =>

    'right now' }, { what => 'eat cake', when => 'quite soon' }); for my $item (@todo) { say "Please $item->{what} $item->{when}." }
  173. my @todo = ({ what => 'eat pie', when =>

    'right now' }, { what => 'eat cake', when => 'quite soon' }); for \my %todo (@todo) { say "Please $item{what} $item{when}." }
  174. my $href = $some->awful->[0]->{chain}; for my $key (keys %$hash) {

    say "$key: $hash->{$key}"; }
  175. \my %href = $some->awful->[0]->{chain}; for my $key (keys %hash) {

    say "$key: $hash{$key}"; }
  176. { \my %href = $some->awful->[0]->{chain}; for my $key (keys %hash)

    { say "$key: $hash{$key}"; } }
  177. for \my %hash ($some->awful->[0]->{chain}) { for my $key (keys %hash)

    { say "$key: $hash{$key}"; } }
  178. reference aliasing (use experimental 'refaliasing')

  179. fasterization

  180. fasterization my @array = split /.../, $string;

  181. fasterization package MyClass { sub new { ... } }

    my $obj = MyClass->new;
  182. fasterization package MyClass { sub new { ... } }

    my $obj = MyClass->new; $obj->UNIVERSAL::isa( ... );
  183. fasterization package MyClass { sub new { ... } }

    my $obj = MyClass->new; $obj->SUPER::new( ... );
  184. fasterization OP_METHOP

  185. fasterization OP_MULTIDEREF

  186. fasterization my $x = $a->[0]{one}[2]{three}{four}[5];

  187. fasterization my $x = $a

  188. fasterization my $x = $a->[0]

  189. fasterization my $x = $a->[0]{one}

  190. fasterization my $x = $a->[0]{one}[2]

  191. fasterization my $x = $a->[0]{one}[2]{three}

  192. fasterization my $x = $a->[0]{one}[2]{three}{four}

  193. fasterization my $x = $a->[0]{one}[2]{three}{four}[5];

  194. fasterization my $x = $a

  195. fasterization my $x = $a->[0]{one}[2]{three}{four}[5];

  196. NaN nananananananananana

  197. None
  198. ==> x (Inf)

  199. ==> x (Inf) 'Inf'

  200. ==> x (Inf) 'Inf' ==> x (Inf + 0)

  201. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

  202. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf)
  203. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf'
  204. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf)
  205. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN'
  206. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN' ==> x (Inf * 0)
  207. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN' ==> x (Inf * 0) 'NaN'
  208. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN' ==> x (Inf * 0) 'NaN' ==> x (NaN + NaN)
  209. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN' ==> x (Inf * 0) 'NaN' ==> x (NaN + NaN) 'NaN'
  210. ==> x (Inf) 'Inf' ==> x (Inf + 0) '#1.INF'

    ==> x (Inf + Inf) '#1.INF' ==> x (Inf - Inf) '#1.IND' ==> x (Inf * 0) '#1.IND' ==> x (NaN + NaN) '#1.QNAN'
  211. ==> x (Inf) 'Inf' ==> x (Inf + 0) 'Inf'

    ==> x (Inf + Inf) 'Inf' ==> x (Inf - Inf) 'NaN' ==> x (Inf * 0) 'NaN' ==> x (NaN + NaN) 'NaN'
  212. None
  213. ==> x (0 + "Nan")

  214. ==> x (0 + "Nan") 'NaN'

  215. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy")
  216. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") 'NaN'
  217. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") 'NaN' ==> x (0 + "123abc")
  218. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") 'NaN' ==> x (0 + "123abc") 123
  219. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") 'NaN' ==> x (0 + "123abc") Argument "123abc" isn't numeric 123
  220. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") 'NaN' ==> x (0 + "123abc") Argument "123abc" isn't numeric 123 ==> x (0 + "Nancy, this is Susan. Susan, this is Nancy.\n\n...") 'NaN'
  221. ==> x (0 + "Nan") 'NaN' ==> x (0 +

    "Nancy") Argument "Nancy" isn't numeric 'NaN' ==> x (0 + "123abc") Argument "123abc" isn't numeric 123 ==> x (0 + "Nancy, this is Susan. Susan, this is Nancy.\n\n...") Argument "Nancy, this is Susan... 'NaN'
  222. not not a numbers

  223. hex floats $x = 1.23e4;

  224. hex floats $x = 0xE.A3p4;

  225. hex floats $x = 1.23e4;

  226. hex floats $x = 1.23e4; $x = ( 1 +

    23 / 100 ) * 10**4;
  227. hex floats $x = 0xE.A3p4;

  228. hex floats $x = 0xE.A3p4; $x = ( 0xE +

    0xA3 / 0x100 ) * 2**4;
  229. hex floats $x = 0xE.A3p4;

  230. hex floats $x = 0xE.A3p4; # 234.1875

  231. hex floats $x = 0xE.A3p4; # 234.1875 printf "%x", $x;

    # "ea"
  232. hex floats $x = 0xE.A3p4; # 234.1875 printf "%x", $x;

    # "ea" printf "%a", $x; # 0x1.d46p+7
  233. hex floats $x = 0xE.A3p4; # 234.1875 printf "%x", $x;

    # "ea" printf "%a", $x; # 0x1.d46p+7 :-)
  234. speaking of numbers and not-numbers

  235. None
  236. NAME!

  237. NAME! THAT!

  238. NAME! THAT! OPERATOR!

  239. name that operator

  240. name that operator $x + $y

  241. name that operator $x + $y $x - $y

  242. name that operator $x + $y $x - $y $x

    * $y
  243. name that operator $x + $y $x - $y $x

    * $y $x / $y
  244. name that operator

  245. name that operator $x eq $y

  246. name that operator $x eq $y $x ne $y

  247. name that operator $x eq $y $x ne $y $x

    lt $y
  248. name that operator $x eq $y $x ne $y $x

    lt $y $x gt $y
  249. name that operator

  250. name that operator $x ~~ $y

  251. name that operator

  252. name that operator $x && $y

  253. name that operator $x && $y $x || $y

  254. name that operator $x && $y $x || $y $x

    xor $y
  255. name that operator

  256. name that operator $x & $y

  257. name that operator $x & $y $x | $y

  258. name that operator $x & $y $x | $y $x

    ^ $y
  259. name that operator $x & $y $x | $y $x

    ^ $y ~ $x
  260. bitwise operator types

  261. bitwise operator types $num1 & $num2

  262. bitwise operator types $num1 & $num2 $str1 & $str2

  263. bitwise operator types $num1 & $num2 $str1 & $str2 $num1

    & $str2
  264. bitwise operator types $num1 & $num2 $str1 & $str2 $num1

    & $str2 $str1 & $num2
  265. bitwise operator types

  266. bitwise operator types use experimental 'bitwise';

  267. bitwise operator types use experimental 'bitwise';

  268. bitwise operator types use experimental 'bitwise'; $x & $y

  269. bitwise operator types use experimental 'bitwise'; $x & $y $x

    &. $y
  270. bitwise operator types

  271. bitwise operator types use experimental 'bitwise';

  272. bitwise operator types use experimental 'bitwise';

  273. bitwise operator types use experimental 'bitwise'; $x | $y

  274. bitwise operator types use experimental 'bitwise'; $x | $y $x

    |. $y
  275. bitwise operator types

  276. bitwise operator types use experimental 'bitwise';

  277. bitwise operator types use experimental 'bitwise';

  278. bitwise operator types use experimental 'bitwise'; $x ^ $y

  279. bitwise operator types use experimental 'bitwise'; $x ^ $y $x

    ^. $y
  280. bitwise operator types

  281. bitwise operator types use experimental 'bitwise';

  282. bitwise operator types use experimental 'bitwise';

  283. bitwise operator types use experimental 'bitwise'; ~ $x

  284. bitwise operator types use experimental 'bitwise'; ~ $x ~. $x

  285. bitstring ops

  286. bitstring ops use experimental 'bitwise';

  287. bitstring ops use experimental 'bitwise';

  288. bitstring ops use experimental 'bitwise'; my $x = "" &.

    "";
  289. bitstring ops use experimental 'bitwise'; my $x = "" &.

    ""; say $x;
  290. (@) (from v5.20.0)

  291. sub add { my ($x, $y) = @_; return $x

    + $y; }
  292. sub add ($x, $y) { return $x + $y; }

  293. sub add ($x, $y = 0) { return $x +

    $y; }
  294. sub add ($x = 0, $y = 0) { return

    $x + $y; }
  295. sub add ($x = 0, $y = return $x) {

    return $x + $y; }
  296. sub add ($x= (return 0), $y= return $x) { return

    $x + $y; }
  297. sub add ( $x = (return 0), $y = return

    $x + do { my $dbh = DBI->connect($DSN); my ($y) = $dbh->selectrow_array( "SELECT rhs FROM op_defaults WHERE op = '+'" ); $y } ) { return $x + $y; }
  298. sub mult_many { my ($factor, @inputs) = @_; return map

    {; $factor * $_ } @inputs }
  299. sub mult_many ($factor, @inputs) { return map {; $factor *

    $_ } @inputs }
  300. sub send_mail ($self, $mail, %arg) { $self->smtp->deliver( $mail, %arg{ 'from',

    'to' }, ); }
  301. sub each ($code, @rest) :prototype(&@) { $code->($_) for @rest; }

    each { say } (1, 2, 3);
  302. sub each :prototype(&@) ($code, @rest) { $code->($_) for @rest; }

    each { say } (1, 2, 3);
  303. sub process_queue { my ($self, $arg, $queue) = @_; for

    my $item ( @$queue ) { debug($item->{name}) if $arg->{debug}; $self->accept($item->{job_id}); } }
  304. sub process_queue ($self, $arg, $queue) { for my $item (

    @$queue ) { debug($item->{name}) if $arg->{debug}; $self->accept($item->{job_id}); } }
  305. sub process_queue ($self, $arg, $queue) { for \my %item (

    @$queue ) { debug($item{name}) if $arg->{debug}; $self->accept($item{job_id}); } }
  306. sub process_queue ($self, $arg, $queue) { for \my %item (

    @$queue ) { debug($item{name}) if $arg->{debug}; $self->accept($item{job_id}); } }
  307. sub process_queue ($self, \%arg, \@queue) { for \my %item (

    @queue ) { debug($item{name}) if $arg{debug}; $self->accept($item{job_id}); } }
  308. Perl 5.22

  309. Perl 5.22 available now!

  310. Perl 5.22

  311. Perl 5.22 available now!

  312. Perl 5.22 available now! higher version number than ever before!

  313. Any Questions?

  314. Thank you!

  315. Perl 5.24?

  316. warnings

  317. warnings

  318. warnings •use warnings;

  319. warnings •use warnings; •use warnings 'all';

  320. warnings •use warnings; •use warnings 'all'; •use warnings 'FATAL';

  321. warnings •use warnings; •use warnings 'all'; •use warnings 'FATAL'; •use

    warnings FATAL => 'all';
  322. warnings use warnings; my $re = qr/(?:-)xyz/;

  323. warnings use warnings; my $re = qr/(?:-)xyz/; Probably-accidental smiley found

    in regexp at line 2
  324. None
  325. massive mailing list thread about :-)

  326. massive mailing list thread about :-)

  327. massive mailing list thread about :-) which is :-(

  328. warnings

  329. warnings •use warnings;

  330. warnings •use warnings; •use warnings 'default';

  331. warnings •use warnings; •use warnings 'default'; •use warnings 'FATAL';

  332. warnings •use warnings; •use warnings 'default'; •use warnings 'FATAL'; •use

    warnings FATAL => 'default';
  333. warnings use warnings; my $re = qr/(?:-)xyz/;

  334. warnings use warnings qw(default smileys); my $re = qr/(?:-)xyz/; Probably-accidental

    smiley found in regexp at line 2
  335. warnings use warnings 'all'; my $re = qr/(?:-)xyz/; Probably-accidental smiley

    found in regexp at line 2
  336. strictures

  337. strictures use strict; while ( my $event = next_event )

    { print { $logfile } "$event\n"; }
  338. strictures # logfile.txt Garbo::Event=HASH(0x03941ae0f) Garbo::Event=HASH(0x03944a30f) Garbo::Event=HASH(0x03941af0f) Garbo::Event=HASH(0x031411eff) Garbo::Event=HASH(0x039110020) Garbo::Event=HASH(0x03941ae0f)

  339. strictures use strict 'stringification'; while ( my $event = next_event

    ) { print { $logfile } "$event\n"; } Can't stringify a reference with no overloading while "strict stringification" in use