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

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

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

    1. Фрагменты Perl 6 в Perl 5.10
    2. Фрагменты Perl 6 в Perl 5.10 и различия
    3. use
feature
qw( 



say 



switch 



state );
    4. use
feature
qw( 



say 



switch 



state ); use
feature
\":5.10\";
    5. use
feature
qw( 



say 



switch 



state ); use
feature
\":5.10\"; use
5.10.0;
    6. use
feature
qw( 



say 



switch 



state ); use
feature
\":5.10\"; use
v5.10.0;
    7. say
    8. my
$x
=
‘UPW2008’; say
$x;
    9. 5.10 my
$x
=
‘UPW2008’; say
$x; UPW2008
    10. 6 my
$x
=
‘UPW2008’; say
$x; UPW2008
    11. 5.10 my
$x
=
‘UPW2008’; say
($x);
    12. 5.10 my
$x
=
‘UPW2008’; say
($x); UPW2008
    13. 6 my
$x
=
‘UPW2008’; say
($x); UPW2008
    14. 6 my
$x
=
‘UPW2008’; say($x); UPW2008
    15. 6 my
$x
=
‘UPW2008’; $x.say; UPW2008
    16. 5.10 my
$x
=
‘UPW2008’; $x.say;
    17. 6 my
$x
=
‘UPW2008’; $x.say(); UPW2008
    18. 5.10 my
$x
=
‘UPW2008’; $x.say(); Undefined
subroutine
 &main::say
called
at
‐e
 line
1
    19. for
(1..3)
{ 



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



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



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



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



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



.say; } 1 2 3
    25. switch
    26. 5.10, 6 my
$str
=
\"YAPC::Asia\";
 given
($str)
{ 



when
(/Asia/)
{ 







say
\"Asia\" 



} }
    27. 5.10, 6 my
$str
=
\"YAPC::Asia\";
 given
($str)
{ 



when
(/Asia/)
{ 







say
\"Asia\" 



} }
    28. 6 my
$str
=
\"YAPC::Asia\";
 given
($str)
{ 



when
(/Asia/)
{ 







say
\"Asia\" 



} }
    29. 6 my
$str
=
\"YAPC::Asia\";
 given
$str
{ 



when
/Asia/
{ 







say
\"Asia\" 



} }
    30. 6 my
$str
=
\"YAPC::Asia\";
 given
$str
{ 



say
\"Asia\"
when
/Asia/
 }
    31. state
    32. sub
f
{ 


state
$c; 


say
++$c; }
    33. sub
f
{ 


state
$c; 


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


state
$c; 


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


state
$c; 


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


state
$c
=
0; 


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


state
$c
=
0; 


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


state
$c
=
0; 


say
++$c; } f();
f();
f(); 1
1
1
    39. //
    40. // defined‐or
    41. my
$c
=
0; my
$d
=
$c
//
3; say
$d;










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










4
    42. ~~
    SlideShare Zeitgeist 2009

    + andy.shandy.sh Nominate

    custom

    400 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 400
      • 400 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags