Enviar pesquisa
Carregar
Perl 5.10
•
0 gostou
•
523 visualizações
A
Andrew Shitov
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 119
Baixar agora
Baixar para ler offline
Recomendados
Фичи 5.10 на практике
Фичи 5.10 на практике
Andrew Shitov
Новое в Perl 5.10
Новое в Perl 5.10
Andrew Shitov
0_Emerging_African_Market_-_Full_Paper-libre
0_Emerging_African_Market_-_Full_Paper-libre
Tensing Rodrigues
Informe explosion e incendio en la refineria de amuay
Informe explosion e incendio en la refineria de amuay
COENERCoener
Si tuvierais fe. lc 17,5 10
Si tuvierais fe. lc 17,5 10
josezarra
Фрагменты Perl 6 в Perl 5.10
Фрагменты Perl 6 в Perl 5.10
Andrew Shitov
5-10 impact 2 low unboxing
5-10 impact 2 low unboxing
BikeWorks
Perl6 one-liners
Perl6 one-liners
Andrew Shitov
Recomendados
Фичи 5.10 на практике
Фичи 5.10 на практике
Andrew Shitov
Новое в Perl 5.10
Новое в Perl 5.10
Andrew Shitov
0_Emerging_African_Market_-_Full_Paper-libre
0_Emerging_African_Market_-_Full_Paper-libre
Tensing Rodrigues
Informe explosion e incendio en la refineria de amuay
Informe explosion e incendio en la refineria de amuay
COENERCoener
Si tuvierais fe. lc 17,5 10
Si tuvierais fe. lc 17,5 10
josezarra
Фрагменты Perl 6 в Perl 5.10
Фрагменты Perl 6 в Perl 5.10
Andrew Shitov
5-10 impact 2 low unboxing
5-10 impact 2 low unboxing
BikeWorks
Perl6 one-liners
Perl6 one-liners
Andrew Shitov
Creating a compiler in Perl 6
Creating a compiler in Perl 6
Andrew Shitov
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)
Andrew Shitov
Perl6 in-production
Perl6 in-production
Andrew Shitov
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
Andrew Shitov
AllPerlBooks.com
AllPerlBooks.com
Andrew Shitov
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
Andrew Shitov
The Joy of Smartmatch
The Joy of Smartmatch
Andrew Shitov
YAPC::Europe 2013
YAPC::Europe 2013
Andrew Shitov
Perl 7, the story of
Perl 7, the story of
Andrew Shitov
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистов
Andrew Shitov
Как очистить массив
Как очистить массив
Andrew Shitov
What's new in Perl 5.14
What's new in Perl 5.14
Andrew Shitov
Что нового в Perl 5.14
Что нового в Perl 5.14
Andrew Shitov
Perl6 grammars
Perl6 grammars
Andrew Shitov
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
Andrew Shitov
There's more than one way to empty it
There's more than one way to empty it
Andrew Shitov
Perl 6 by example
Perl 6 by example
Andrew Shitov
How to clean an array
How to clean an array
Andrew Shitov
Perl 5.10 и 5.12
Perl 5.10 и 5.12
Andrew Shitov
Say Perl на весь мир
Say Perl на весь мир
Andrew Shitov
Mais conteúdo relacionado
Mais de Andrew Shitov
Creating a compiler in Perl 6
Creating a compiler in Perl 6
Andrew Shitov
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)
Andrew Shitov
Perl6 in-production
Perl6 in-production
Andrew Shitov
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
Andrew Shitov
AllPerlBooks.com
AllPerlBooks.com
Andrew Shitov
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
Andrew Shitov
The Joy of Smartmatch
The Joy of Smartmatch
Andrew Shitov
YAPC::Europe 2013
YAPC::Europe 2013
Andrew Shitov
Perl 7, the story of
Perl 7, the story of
Andrew Shitov
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистов
Andrew Shitov
Как очистить массив
Как очистить массив
Andrew Shitov
What's new in Perl 5.14
What's new in Perl 5.14
Andrew Shitov
Что нового в Perl 5.14
Что нового в Perl 5.14
Andrew Shitov
Perl6 grammars
Perl6 grammars
Andrew Shitov
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
Andrew Shitov
There's more than one way to empty it
There's more than one way to empty it
Andrew Shitov
Perl 6 by example
Perl 6 by example
Andrew Shitov
How to clean an array
How to clean an array
Andrew Shitov
Perl 5.10 и 5.12
Perl 5.10 и 5.12
Andrew Shitov
Say Perl на весь мир
Say Perl на весь мир
Andrew Shitov
Mais de Andrew Shitov
(20)
Creating a compiler in Perl 6
Creating a compiler in Perl 6
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)
Perl6 in-production
Perl6 in-production
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
AllPerlBooks.com
AllPerlBooks.com
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
The Joy of Smartmatch
The Joy of Smartmatch
YAPC::Europe 2013
YAPC::Europe 2013
Perl 7, the story of
Perl 7, the story of
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистов
Как очистить массив
Как очистить массив
What's new in Perl 5.14
What's new in Perl 5.14
Что нового в Perl 5.14
Что нового в Perl 5.14
Perl6 grammars
Perl6 grammars
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
There's more than one way to empty it
There's more than one way to empty it
Perl 6 by example
Perl 6 by example
How to clean an array
How to clean an array
Perl 5.10 и 5.12
Perl 5.10 и 5.12
Say Perl на весь мир
Say Perl на весь мир
Perl 5.10
1.
Perl 5.10
2.
Versions of Perl
(perlhist) 5.000 17 October 1994 22 March 2000 5.6.0 18 July 2002 5.8.0 31 January 2006 5.8.8 18 December 2008 5.10
3.
Versions of Perl
(perlhist) 5.000 17 October 1994 22 March 2000 5.6.0 18 July 2002 5.8.0 31 January 2006 5.8.8 18 December 2008 5.10 ? 6.0
4.
Versions of Perl
(perlhist) 5.000 17 October 1994 22 March 2000 5.6.0 18 July 2002 5.8.0 31 January 2006 5.8.8 18 December 2008 5.10 Сhristmas 6.0
5.
Versions of Perl
(perlhist) 5.000 17 October 1994 22 March 2000 5.6.0 18 July 2002 5.8.0 31 January 2006 5.8.8 18 December 2008 5.10 2000 6.0
6.
use feature
7.
use feature qw( say switch state );
8.
use feature qw( say switch state ); use feature quot;:5.10quot;;
9.
use feature qw( say switch state ); use feature quot;:5.10quot;; use 5.10.0;
10.
use feature qw( say switch state ); use feature quot;:5.10quot;; use v5.10.0;
11.
#!/perl5.10/bin/perl use feature quot;***quot;;
12.
#!/perl5.10/bin/perl use feature quot;sayquot;; say quot;Perl 6?quot;;
13.
#!/perl5.10/bin/perl use feature quot;sayquot;; say quot;Perl 6?quot;; no feature quot;sayquot;;
14.
> perl5.10 ‐e quot;use feature qw(say); say $$;quot;
15.
> perl5.10 ‐e quot;use feature qw(say); say $$;quot; > perl5.10 ‐E quot;say $$;quot;
16.
// defined‐or
17.
my $a; my $b = $a // 2; say $b; 2
18.
my $c = 0; my $d = $c // 3; say $d; 0 my $e = 0; my $f = $e || 4; say $f; 4
19.
my $_;
20.
for (1..5) { my $_ = '*'; print; } *****
21.
$::_
22.
for (1..5) { my $_ = '*'; print $::_; } 12345
23.
our $_;
24.
for (1..5) { our $_ = '*'; print $::_; } *****
25.
use strict 'refs'; my $x = '***'; print 1 if defined $$x;
26.
use strict 'refs'; my $var = '***'; print defined $$var ? 'yes' : 'no'; > perl5.8.8 test.pl no
27.
use strict 'refs'; my $var = '***'; print defined $$var ? 'yes' : 'no'; > perl5.10 test.pl Can't use string (quot;xxxquot;) as a SCALAR ref while quot;strict refsquot; in use at test.pl line 3.
28.
use feature 'switch';
29.
use feature qw(switch say); my $tag = 'hrpw2008'; given ($tag) { when ('hrpw2008') { say 'Yes'; } }
30.
use feature qw(switch say); my $tag = 'hrpw2008'; given ($tag) { when ('hrpw2008') { say 'Yes'; } default {say 'No';} }
31.
when (123) when ($value) when (undef) when ([2001..2100]) when (/d+/)
32.
when ($_ > 0) when (int) when (int $_) when (&test_the_value) when (test_the_value($_))
33.
given ('hrpw2008') { when (/d+/) { say 'digits'; continue; } when (/perl/i) { say 'Perl'; } }
34.
when ($what)
== when ($_ ~~ $what)
35.
$left ~~ $right
== $right ~~ $left
36.
use feature 'state';
37.
sub counter{ state $value = 0; $value++; say $value; } counter(); 1 counter(); 2 counter(); 3
38.
Regular Expressions
39.
Named saving parens my $date = 'Thu 15 April 2008'; $date =~ / ( w+ ) s+ ( d+ ) s+ ( w+ ) s+ ( d{4}) /x; say $1; Thu say $4; 2008
40.
Named saving parens my $date = 'Thu 15 April 2008'; $date =~ / (?<wday> w+ ) s+ (?<day> d+ ) s+ (?<month> w+ ) s+ (?<year> d{4}) /x; say $+{wday}; Thu say $+{year}; 2008
41.
Named saving parens my $date = 'Thu 15 April 2008'; $date =~ s/
(?<year>d{4}) / $+{year} + 1 /xe; say $date; Thu 15 April 2009
42.
my $code = 'my $value = 100; say $value;'; $code =~ s/ my s* (?<variable> $[a‐z]+) s* = s* (?<value> [^;]+ ) s* ; s* (?<other_code>.*?) (k<variable>) /$+{other_code}$+{value}/x; say $code; say 100;
43.
my $leap_years = '1992 1996 2004 2008'; $leap_years =~ m/ ( ?<year> 1 d{3} ) s* ( ?<year> 2 d{3} ) /x; say $_ for @{$‐{year}}; 1996 2004
44.
my $leap_years = '1992 1996 2004 2008'; $leap_years =~ m/ ( ?<year> 1 d{3} ) /gx; say $_ for @{$‐{year}}; 1992
45.
my $leap_years = '1992 1996 2004 2008'; $leap_years =~ m/ ( ?<year> 1 d{3} s* )+ /gx; say $_ for @{$‐{year}}; 1996
46.
use feature 'say'; my $expr = '1 + (2 + (3 + (4 + 5) + 6))'; $expr =~ s/ ( ( [^()]+ ) | (?1) ) /say $1;/xge;
47.
Posessive quantifiers
?+ *+ ++ {min, max}+
48.
/ quot; (?: [^quot;]++ | . )*+ quot; /x
49.
(?| ...)
50.
my $re = qr/ (d{4})(dd)(dd) | (w+),s*(d{4})) /x; '20080415' =~ $re; say quot;$1 . $2 . $3quot;; 'April, 2008' =~ $re; say quot;$4 . $5quot;;
51.
my $re = qr/ (?|(d{4})(dd)(dd) | (w+),s*(d{4}))) /x; '20080415' =~ $re; say quot;$1 . $2 . $3quot;; 'April, 2008' =~ $re; say quot;$1 . $2quot;;
52.
g{N} gN
53.
g{‐N}
54.
k<named> == g{named}
55.
K
56.
v h
57.
V H
58.
R
59.
R
(?> x0Dx0A? | [ x0A‐x0C x85 x{2028} x{2029} ] )
60.
Smart matching
~~
61.
$a ~~ $b
== $b ~~ $a
62.
my $b; $b ~~ undef !defined $b
63.
my $c = 'abc'; $c ~~ 'abc' $c eq 'abc'
64.
my $c = 'abc'; $c ~~ /b/ $c =~ /b/
65.
my @a = (1..3); my @b = (1..3); @a ~~ @b 1 == 1 && 2 == 2 && 3 == 3
66.
my @a = (1..3); my @b = (1..3); my @c = (3..5); @a ~~ @c 1 == 3 && 2 == 4 && 3 == 5
67.
my @d = (123, 'abc'); my @e = (qr/d/, qr/w/); @d ~~ @e 123 ~~ /d/ && 'abc' ~~ /w/
68.
my @f = ('a'..'f'); @f ~~ 'd' grep {$_ eq 'd'} @f
69.
my @g = (1..10); @g ~~ 7 grep {$_ == 7} @g
70.
my @g = (1..10); @g ~~ 7.0 grep {$_ == 7.0} @g
71.
my @g = (1..10); @g ~~ '7.0' grep {$_ eq '7.0'} @g
72.
my @g = (1..10); @g ~~ /^d$/ grep {$_ =~ /^d$/} @g
73.
3.14 ~~ '3.14' 3.14 == '3.14'
74.
3.14 ~~ '3.14%' 3.14 == '3.14%'
75.
sub subA {return 2} sub subB {return 2} subA ~~ subB subA() == subB()
76.
sub subA {return 2} my $subA1_ref = &subA; my $subA2_ref = &subA; $subA1_ref ~~ $subA2_ref $subA1_ref == $subA2_ref
77.
sub subA {return 2} my $subA_ref = &subA; $a ~~ $subA_ref $subA_ref‐>($a)
78.
sub subA {return 2} my $subA_ref = &subA; ‐1 ~~ $subA_ref $subA_ref‐>(‐1)
79.
my %h = (a => 'alpha', b => 'beta'); %h ~~ 'a' exists $h{'a'}
80.
my %h = (a => 'alpha', b => 'beta'); my @f = ('a'..'f'); %h ~~ @f grep {$_} @h{@f}
81.
my %h = (a => 'alpha', b => 'beta'); %h ~~ /[A‐F]/i grep {/[A‐F]/i} keys %h
82.
my %h = (a => 'alpha', b => 'beta'); my %hh = (b => 1, a => 2); %h ~~ %hh [sort keys %h] ~~ [sort keys %hh]
83.
Elements of Perl
6 in Perl 5.10
84.
Elements of Perl
6 in Perl 5.10 and differencies
85.
say
86.
my $x = 'HRPW2008'; say $x;
87.
5.10 my $x = 'HRPW2008'; say $x; HRPW2008
88.
6 my $x = 'HRPW2008'; say $x; HRPW2008
89.
5.10 my $x = 'HRPW2008'; say ($x);
90.
5.10 my $x = 'HRPW2008'; say ($x); HRPW2008
91.
6 my $x = 'HRPW2008'; say ($x); HRPW2008
92.
6 my $x = 'HRPW2008'; say($x); HRPW2008
93.
6 my $x = 'HRPW2008; $x.say; HRPW2008
94.
5.10 my $x = 'HRPW2008'; $x.say;
95.
5.10 my $x = 'HRPW2008'; $x.say; String concatenation!
96.
6 my $x = 'HRPW2008'; $x.say(); HRPW2008
97.
$_
98.
for (1..3) { say; }
99.
5.10 for (1..3) { say; } 1 2 3
100.
6 for (1..3) { say; } n n n
101.
6 for (1..3) { say $_; } 1 2 3
102.
6 for (1..3) { $_.say; } 1 2 3
103.
6 for (1..3) { .say; } 1 2 3
104.
switch
105.
5.10, 6 my $str = quot;YAPC::Asiaquot;; given ($str) { when (/Asia/) { say quot;Asiaquot; } }
106.
5.10, 6 my $str = quot;YAPC::Asiaquot;; given ($str) { when (/Asia/) { say quot;Asiaquot; } }
107.
6 my $str = quot;YAPC::Asiaquot;; given ($str) { when (/Asia/) { say quot;Asiaquot; } }
108.
6 my $str = quot;YAPC::Asiaquot;; given $str { when /Asia/ { say quot;Asiaquot; } }
109.
6 my $str = quot;YAPC::Asiaquot;; given $str { say quot;Asiaquot; when /Asia/ }
110.
state
111.
sub f { state $c; say ++$c; }
112.
sub f { state $c; say ++$c; } f(); f(); f();
113.
5.10 sub f { state $c; say ++$c; } f(); f(); f(); 1 2 3
114.
6 sub f { state $c; say ++$c; } f(); f(); f(); 1 2 3
115.
sub f { state $c = 0; say ++$c; } f(); f(); f();
116.
5.10 sub f { state $c = 0; say ++$c; } f(); f(); f(); 1 2 3
117.
pugs sub f { state $c = 0; say ++$c; } f(); f(); f(); 1 1 1
118.
119.
Croatian Perl Workshop, Zagreb,
2008 __END__ Andrew Shitov mail@andy.sh | http://andy.sh
Baixar agora