Submit Search
Upload
Новое в Perl 5.10
•
0 likes
•
328 views
A
Andrew Shitov
Follow
Technology
Report
Share
Report
Share
1 of 62
Download now
Download to read offline
Recommended
Perl 5.10
Perl 5.10
Andrew Shitov
Танки в Лунапарке: нагрузочное тестирование в Яндексе
Танки в Лунапарке: нагрузочное тестирование в Яндексе
yaevents
Yeoman is awesome
Yeoman is awesome
DataArt
Criptografía
Criptografía
Samary Páez
Inbound aamiainen 14.6.2016
Inbound aamiainen 14.6.2016
Jani Aaltonen
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
Recommended
Perl 5.10
Perl 5.10
Andrew Shitov
Танки в Лунапарке: нагрузочное тестирование в Яндексе
Танки в Лунапарке: нагрузочное тестирование в Яндексе
yaevents
Yeoman is awesome
Yeoman is awesome
DataArt
Criptografía
Criptografía
Samary Páez
Inbound aamiainen 14.6.2016
Inbound aamiainen 14.6.2016
Jani Aaltonen
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
More Related Content
More from Andrew Shitov
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
More from Andrew Shitov
(20)
Perl6 one-liners
Perl6 one-liners
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
Новое в Perl 5.10
1.
Perl 5.10
2.
CPAN perl-5.10.0-RC1
3.
#!/perl5.10/bin/perl > perl5.10 script.pl
4.
use feature
5.
use feature qw( say switch state );
6.
use feature qw( say switch state ); use feature quot;:5.10quot;;
7.
use feature qw( say switch state ); use feature quot;:5.10quot;; use 5.10.0;
8.
use feature qw( say switch state ); use feature quot;:5.10quot;; use v5.10.0;
9.
#!/perl5.10/bin/perl use feature quot;***quot;;
10.
#!/perl5.10/bin/perl use feature quot;sayquot;; say quot;Perl 6?quot;;
11.
#!/perl5.10/bin/perl use feature quot;sayquot;; say quot;Perl 6?quot;; no feature quot;sayquot;;
12.
> perl5.10 ‐e quot;use feature qw(say); say $$;quot;
13.
> perl5.10 ‐e quot;use feature qw(say); say $$;quot; > perl5.10 ‐E quot;say $$;quot;
14.
// defined‐or
15.
my $a; my $b = $a // 2; say $b; 2
16.
my $c = 0; my $d = $c // 3; say $d; 0 my $e = 0; my $f = $e || 4; say $f; 4
17.
my $_;
18.
for (1..5) { my $_ = '*'; print; } *****
19.
$::_
20.
for (1..5) { my $_ = '*'; print $::_; } 12345
21.
our $_;
22.
for (1..5) { our $_ = '*'; print $::_; } *****
23.
> perl5.10 ‐E quot;say for 1..3quot; > perl6 ‐e quot;say for 1..3quot;
24.
> perl5.10 ‐E
1 quot;say for 1..3quot; 2 3 n > perl6 ‐e n quot;say for 1..3quot; n
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.
~~
29.
use feature 'say'; my $date = 'Thu 22 November, 2007'; say 'Today' if $date ~~ /Thu/;
30.
use feature 'switch';
31.
use feature qw(switch say); my $tag = 'perlrus08'; given ($tag) { when ('perlrus08') { say 'Yes'; } }
32.
use feature qw(switch say); my $tag = 'perlrus08'; given ($tag) { when ('perlrus08') { say 'Yes'; } default {say 'No';} }
33.
when (123) when ($value) when (undef) when ([2001..2100]) when (/d+/)
34.
when ($_ > 0) when (int) when (int $_) when (&test_the_value) when (test_the_value($_))
35.
given ('perlrus08') { when (/d+/) { say 'digits'; continue; } when (/perl/i) { say 'Perl'; } }
36.
when ($what)
== when ($_ ~~ $what)
37.
$left ~~ $right
== $right ~~ $left
38.
use feature 'state';
39.
sub counter{ state $value = 0; $value++; say $value; } counter(); 1 counter(); 2 counter(); 3
40.
Регулярные выражения
41.
Именованные буферы my $date = 'Thu 22 November 2007'; $date =~ / ( w+ ) s+ ( d+ ) s+ ( w+ ) s+ ( d{4}) /x; say $1; Thu say $4; 2007
42.
Именованные буферы my $date = 'Thu 22 November 2007'; $date =~ / (?<wday> w+ ) s+ (?<day> d+ ) s+ (?<month> w+ ) s+ (?<year> d{4}) /x; say $+{wday}; Thu say $+{year}; 2007
43.
Именованные буферы my $date = 'Thu 22 November 2007'; $date =~ s/ (?<year>d{4}) / $+{year} + 1 /xe; say $date; Thu 22 November 2008
44.
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;
45.
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
46.
my $leap_years = '1992 1996 2004 2008'; $leap_years =~ m/ ( ?<year> 1 d{3} ) /gx; say $_ for @{$‐{year}}; 1992
47.
my $leap_years = '1992 1996 2004 2008'; $leap_years =~ m/ ( ?<year> 1 d{3} s* )+ /gx; say $_ for @{$‐{year}}; 1996
48.
use feature 'say'; my $expr = '1 + (2 + (3 + (4 + 5) + 6))'; $expr =~ s/ ( ( [^()]+ ) | (?1) ) /say $1;/xge;
49.
Posessive quantifiers
?+ *+ ++ {min, max}+
50.
/ quot; (?: [^quot;]++ | . )*+ quot; /x
51.
(?| ...)
52.
my $re = qr/ (d{4})(dd)(dd) | (w+),s*(d{4})) /x; '20071122' =~ $re; say quot;$1 . $2 . $3quot;; 'November, 2007' =~ $re; say quot;$4 . $5quot;;
53.
my $re = qr/ (?|(d{4})(dd)(dd) | (w+),s*(d{4}))) /x; '20071122' =~ $re; say quot;$1 . $2 . $3quot;; 'November, 2007' =~ $re; say quot;$1 . $2quot;;
54.
g{N} gN
55.
g{‐N}
56.
k<named> == g{named}
57.
K
58.
v h
59.
V H
60.
R
61.
R
(?> x0Dx0A? | [ x0A‐x0C x85 x{2028} x{2029} ] )
62.
__END__ __DATA__ Андрей Шитов — 2007 andy@shitov.ru | http://shitov.ru
Download now