SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Фрагменты Perl 6
   в Perl 5.10
Фрагменты Perl 6
   в Perl 5.10
  и различия
use
feature
qw(




say




switch




state
);
use
feature
qw(




say




switch




state
);

use
feature
quot;:5.10quot;;
use
feature
qw(




say




switch




state
);

use
feature
quot;:5.10quot;;
use
5.10.0;
use
feature
qw(




say




switch




state
);

use
feature
quot;:5.10quot;;
use
v5.10.0;
say
my
$x
=
‘UPW2008’;
say
$x;
5.10
my
$x
=
‘UPW2008’;
say
$x;

UPW2008
6
my
$x
=
‘UPW2008’;
say
$x;

UPW2008
5.10
my
$x
=
‘UPW2008’;
say
($x);
5.10
my
$x
=
‘UPW2008’;
say
($x);

UPW2008
6
my
$x
=
‘UPW2008’;
say
($x);

UPW2008
6
my
$x
=
‘UPW2008’;
say($x);

UPW2008
6
my
$x
=
‘UPW2008’;
$x.say;

UPW2008
5.10
my
$x
=
‘UPW2008’;
$x.say;
6
my
$x
=
‘UPW2008’;
$x.say();

UPW2008
5.10
my
$x
=
‘UPW2008’;
$x.say();
Undefined
subroutine

&main::say
called
at
‐e

line
1
for
(1..3)
{




say;
}
5.10
for
(1..3)
{




say;
}
1
2
3
6
for
(1..3)
{




say;
}
n
n
n
6
for
(1..3)
{




say
$_;
}
1
2
3
6
for
(1..3)
{




$_.say;
}
1
2
3
6
for
(1..3)
{




.say;
}
1
2
3
switch
5.10, 6
my
$str
=
quot;YAPC::Asiaquot;;

given
($str)
{




when
(/Asia/)
{








say
quot;Asiaquot;




}
}
5.10, 6
my
$str
=
quot;YAPC::Asiaquot;;

given
($str)
{




when
(/Asia/)
{








say
quot;Asiaquot;




}
}
6
my
$str
=
quot;YAPC::Asiaquot;;

given
($str)
{




when
(/Asia/)
{








say
quot;Asiaquot;




}
}
6
my
$str
=
quot;YAPC::Asiaquot;;

given
$str
{




when
/Asia/
{








say
quot;Asiaquot;




}
}
6
my
$str
=
quot;YAPC::Asiaquot;;

given
$str
{




say
quot;Asiaquot;
when
/Asia/

}
state
sub
f
{



state
$c;



say
++$c;
}
sub
f
{



state
$c;



say
++$c;
}
f();
f();
f();
5.10
sub
f
{



state
$c;



say
++$c;
}
f();
f();
f();
1
2
3
6
sub
f
{



state
$c;



say
++$c;
}
f();
f();
f();
1
2
3
sub
f
{



state
$c
=
0;



say
++$c;
}
f();
f();
f();
5.10
sub
f
{



state
$c
=
0;



say
++$c;
}
f();
f();
f();
1
2
3
pugs
sub
f
{



state
$c
=
0;



say
++$c;
}
f();
f();
f();
1
1
1
//
//

defined‐or
my
$c
=
0;
my
$d
=
$c
//
3;
say
$d;










0

my
$e
=
0;
my
$f
=
$e
||
4;
say
$f;










4
~~

Weitere ähnliche Inhalte

Was ist angesagt?

JSplash swf to javascript converter(2008/9/30)
JSplash swf to javascript converter(2008/9/30)JSplash swf to javascript converter(2008/9/30)
JSplash swf to javascript converter(2008/9/30)
gyuque
 
Enlistment Letter
Enlistment LetterEnlistment Letter
Enlistment Letter
guestd8123
 

Was ist angesagt? (19)

2010 01 print-test
2010 01 print-test2010 01 print-test
2010 01 print-test
 
Smartphone
SmartphoneSmartphone
Smartphone
 
Reach magazine 2018 - my research
Reach magazine 2018  - my researchReach magazine 2018  - my research
Reach magazine 2018 - my research
 
Temas oftalmologia
Temas oftalmologiaTemas oftalmologia
Temas oftalmologia
 
Genetica cto 7
Genetica cto 7Genetica cto 7
Genetica cto 7
 
Oftalmo cto 7
Oftalmo cto 7Oftalmo cto 7
Oftalmo cto 7
 
Avk cover
Avk coverAvk cover
Avk cover
 
albawardi
albawardialbawardi
albawardi
 
وما أرسلناك إلا رحمة للعالمين
وما أرسلناك إلا رحمة للعالمينوما أرسلناك إلا رحمة للعالمين
وما أرسلناك إلا رحمة للعالمين
 
JSplash swf to javascript converter(2008/9/30)
JSplash swf to javascript converter(2008/9/30)JSplash swf to javascript converter(2008/9/30)
JSplash swf to javascript converter(2008/9/30)
 
Accounting Chapter 9 Lecture 02
Accounting Chapter 9 Lecture 02Accounting Chapter 9 Lecture 02
Accounting Chapter 9 Lecture 02
 
Wayne victory garden
Wayne victory gardenWayne victory garden
Wayne victory garden
 
Protegendo sites php no seu servidor web
Protegendo sites php no seu servidor webProtegendo sites php no seu servidor web
Protegendo sites php no seu servidor web
 
ريادة إعلام العلاقات
ريادة إعلام العلاقاتريادة إعلام العلاقات
ريادة إعلام العلاقات
 
Cuestionario
CuestionarioCuestionario
Cuestionario
 
Reumatología cto 7
Reumatología cto 7Reumatología cto 7
Reumatología cto 7
 
Dia del libro salud mental axarquía (3)
Dia del libro salud mental axarquía (3)Dia del libro salud mental axarquía (3)
Dia del libro salud mental axarquía (3)
 
Pseudo Perl
Pseudo PerlPseudo Perl
Pseudo Perl
 
Enlistment Letter
Enlistment LetterEnlistment Letter
Enlistment Letter
 

Mehr von Andrew Shitov

The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
Andrew Shitov
 

Mehr von Andrew Shitov (20)

Perl6 one-liners
Perl6 one-linersPerl6 one-liners
Perl6 one-liners
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6
 
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
 
AllPerlBooks.com
AllPerlBooks.comAllPerlBooks.com
AllPerlBooks.com
 
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 
YAPC::Europe 2013
YAPC::Europe 2013YAPC::Europe 2013
YAPC::Europe 2013
 
Perl 7, the story of
Perl 7, the story ofPerl 7, the story of
Perl 7, the story of
 
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистовЯзык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистов
 
Как очистить массив
Как очистить массивКак очистить массив
Как очистить массив
 
What's new in Perl 5.14
What's new in Perl 5.14What's new in Perl 5.14
What's new in Perl 5.14
 
Что нового в Perl 5.14
Что нового в Perl 5.14Что нового в Perl 5.14
Что нового в Perl 5.14
 
Perl6 grammars
Perl6 grammarsPerl6 grammars
Perl6 grammars
 
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Text 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 itThere's more than one way to empty it
There's more than one way to empty it
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
How to clean an array
How to clean an arrayHow to clean an array
How to clean an array
 
Perl 5.10 и 5.12
Perl 5.10 и 5.12Perl 5.10 и 5.12
Perl 5.10 и 5.12
 

Фрагменты Perl 6 в Perl 5.10