SlideShare une entreprise Scribd logo
1  sur  55
( ) versus ,

Damien Krotkine ( dams )
Parens versus Comma
Parens versus Comma
     or, what people say...
Parens versus Comma
              or, what people say...

or, a lame excuse to play with Keynote’s effects...
my @array = ( 1, 2, 3 )
my @array = ( 1, 2, 3 )
my @array = ( 1, 2, 3 )
my @array = ( 1, 2, 3 )



               ( 1, 2, 3 )


That’s a list, right ?
my @array = ( 1, 2, 3 )



               ( 1, 2, 3 )


That’s a list, right ?
But what makes it a list ?
People say
“ Oh that’s the parens”
“ The parentheses make it a list”
People say
“ Oh that’s the parens”
“ The parentheses make it a list”

People also say :
“ See, if you remove the parentheses, it doesn’t
work”
my @array = (1, 2, 3);
say “@array” # returns 1 2 3



             Yay !
my @array = 1, 2, 3 ;
say “@array” # returns 1



            Booh !
So people say

“ So, it must be the parentheses”

So now people say :

“parentheses are the list operator in Perl 5”
I say :

“Oh really ? ”
Let’s see... operators, what’s the list of Perl
operators ?
Let’s see... operators, what’s the list of Perl
operators ?

man perlop
->                       &
++ --                    | ^
**                       &&
! ~  + -                || //
=~ !~                    .. ...
* / % x                  ?:
+ - .                    = += -= *= etc.
<< >>                    , =>
< > <= >= lt gt le ge    not
== != <=> eq ne cmp ~~   and
                         xor
->                           &
++ --                        | ^
**                           &&
! ~  + -                    || //
=~ !~                        .. ...
* / % x                      ?:
+ - .                        = += -= *= etc.
<< >>                        , =>
< > <= >= lt gt le ge        not
== != <=> eq ne cmp ~~       and
                             xor

  There is no ( ) operator
->                           &
++ --                        | ^
**                           &&
! ~  + -                    || //
=~ !~                        .. ...
* / % x                      ?:
+ - .                        = += -= *= etc.
<< >>                        , =>
< > <= >= lt gt le ge        not
== != <=> eq ne cmp ~~       and
                             xor

  There is no ( ) operator
->                           &
++ --                        | ^
**                           &&
! ~  + -                    || //
=~ !~                        .. ...
* / % x                      ?:
+ - .                        = += -= *= etc.
<< >>                        , =>
< > <= >= lt gt le ge        not
== != <=> eq ne cmp ~~       and
                             xor

  There is no ( ) operator
  However there is a comma operator
->                           &
++ --                        | ^
**                           &&
! ~  + -                    || //
=~ !~                        .. ...
* / % x                      ?:
+ - .                        = += -= *= etc.
<< >>                        , =>
< > <= >= lt gt le ge        not
== != <=> eq ne cmp ~~       and
                             xor

  There is no ( ) operator
  However there is a comma operator
  , That’s the operator
The comma operator has a very low
precedence, but it’s still an operator

Parentheses ( ) are just there to modify
precedence
( 1, 2, 3 ) is a list
( 1, 2, 3 ) is a list

1, 2, 3 is also a list
my @list = 1, 2, 3
my @list = 1, 2, 3
So why doesn’t this work ?
my @list = 1, 2, 3
So why doesn’t this work ?

That’s because = has greater precedence
than ,
my @array = 1, 2, 3;
my @array = 1, 2, 3;
is really
my @array = 1, 2, 3;
is really
(my @array = 1), 2, 3;
my @array = 1, 2, 3;
is really
(my @array = 1), 2, 3;
And it’s also
And it’s also

( (my @array = 1), 2, 3 );
And it’s also

( (my @array = 1), 2, 3 );

So it’s really a list ! We are just not looking
at it completely when looking at @array
Why is it useful to know ?
It makes you realize you don’t need ( ) in
many situations
return 1, 2, 3;
return 1, 2, 3;
do_stuff or log(“error”), die;
return 1, 2, 3;
do_stuff or log(“error”), die;
my $self = bless { }, $class;
return 1, 2, 3;
do_stuff or log(“error”), die;
my $self = bless { }, $class;
etc.
return 1, 2, 3;
do_stuff or log(“error”), die;
my $self = bless { }, $class;
etc.
btw this doesn’t work
return 1, 2, 3;
do_stuff or log(“error”), die;
my $self = bless { }, $class;
etc.
btw this doesn’t work
do_stuff || log(“error”), die;
return 1, 2, 3;
do_stuff or log(“error”), die;
my $self = bless { }, $class;
etc.
btw this doesn’t work
do_stuff || log(“error”), die;
=> go learn your operators’ precedence
So please don’t say that ( ) is the Perl 5 list
operator: it is not

Give more love to the comma operator,
it’s often forgotten
So please don’t say that ( ) is the Perl 5 list
operator: it is not

Give more love to the comma operator,
it’s often forgotten


                 ♥
So please don’t say that ( ) is the Perl 5 list
operator: it is not

Give more love to the comma operator,
it’s often forgotten


                 ♥
And don’t listen to what people say...
Thanks




         Damien Krotkine ( dams )

Contenu connexe

Similaire à Comma versus list

2 2. operators
2 2. operators2 2. operators
2 2. operators웅식 전
 
Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fuclimatewarrior
 
Perl 6 in Context
Perl 6 in ContextPerl 6 in Context
Perl 6 in Contextlichtkind
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskellujihisa
 
F# Presentation
F# PresentationF# Presentation
F# Presentationmrkurt
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick touraztack
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a bossgsterndale
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)ujihisa
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1Dave Cross
 
Data Pipelines in Swift
Data Pipelines in SwiftData Pipelines in Swift
Data Pipelines in SwiftJason Larsen
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangSean Cribbs
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swiftChiwon Song
 
Python language data types
Python language data typesPython language data types
Python language data typesHarry Potter
 
Python language data types
Python language data typesPython language data types
Python language data typesHoang Nguyen
 
Python language data types
Python language data typesPython language data types
Python language data typesYoung Alista
 

Similaire à Comma versus list (20)

2 2. operators
2 2. operators2 2. operators
2 2. operators
 
Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fu
 
Perl 6 in Context
Perl 6 in ContextPerl 6 in Context
Perl 6 in Context
 
operators.ppt
operators.pptoperators.ppt
operators.ppt
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
F# Presentation
F# PresentationF# Presentation
F# Presentation
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a boss
 
Python Workshop
Python  Workshop Python  Workshop
Python Workshop
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Data Pipelines in Swift
Data Pipelines in SwiftData Pipelines in Swift
Data Pipelines in Swift
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swift
 
Python language data types
Python language data typesPython language data types
Python language data types
 
Python language data types
Python language data typesPython language data types
Python language data types
 
Python language data types
Python language data typesPython language data types
Python language data types
 

Plus de Damien Krotkine

Stockage et analyse temps réel d'événements avec Riak chez Booking.com
Stockage et analyse temps réel d'événements avec Riak chez Booking.comStockage et analyse temps réel d'événements avec Riak chez Booking.com
Stockage et analyse temps réel d'événements avec Riak chez Booking.comDamien Krotkine
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comDamien Krotkine
 

Plus de Damien Krotkine (6)

Stockage et analyse temps réel d'événements avec Riak chez Booking.com
Stockage et analyse temps réel d'événements avec Riak chez Booking.comStockage et analyse temps réel d'événements avec Riak chez Booking.com
Stockage et analyse temps réel d'événements avec Riak chez Booking.com
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.com
 
Riak introduction
Riak introductionRiak introduction
Riak introduction
 
Message passing
Message passingMessage passing
Message passing
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
Curses::Toolkit
Curses::ToolkitCurses::Toolkit
Curses::Toolkit
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Comma versus list

  • 1. ( ) versus , Damien Krotkine ( dams )
  • 3. Parens versus Comma or, what people say...
  • 4. Parens versus Comma or, what people say... or, a lame excuse to play with Keynote’s effects...
  • 5. my @array = ( 1, 2, 3 )
  • 6. my @array = ( 1, 2, 3 )
  • 7. my @array = ( 1, 2, 3 )
  • 8. my @array = ( 1, 2, 3 ) ( 1, 2, 3 ) That’s a list, right ?
  • 9. my @array = ( 1, 2, 3 ) ( 1, 2, 3 ) That’s a list, right ? But what makes it a list ?
  • 10. People say “ Oh that’s the parens” “ The parentheses make it a list”
  • 11. People say “ Oh that’s the parens” “ The parentheses make it a list” People also say : “ See, if you remove the parentheses, it doesn’t work”
  • 12. my @array = (1, 2, 3); say “@array” # returns 1 2 3 Yay !
  • 13. my @array = 1, 2, 3 ; say “@array” # returns 1 Booh !
  • 14. So people say “ So, it must be the parentheses” So now people say : “parentheses are the list operator in Perl 5”
  • 15. I say : “Oh really ? ”
  • 16.
  • 17. Let’s see... operators, what’s the list of Perl operators ?
  • 18. Let’s see... operators, what’s the list of Perl operators ? man perlop
  • 19.
  • 20. -> & ++ -- | ^ ** && ! ~ + - || // =~ !~ .. ... * / % x ?: + - . = += -= *= etc. << >> , => < > <= >= lt gt le ge not == != <=> eq ne cmp ~~ and xor
  • 21. -> & ++ -- | ^ ** && ! ~ + - || // =~ !~ .. ... * / % x ?: + - . = += -= *= etc. << >> , => < > <= >= lt gt le ge not == != <=> eq ne cmp ~~ and xor There is no ( ) operator
  • 22. -> & ++ -- | ^ ** && ! ~ + - || // =~ !~ .. ... * / % x ?: + - . = += -= *= etc. << >> , => < > <= >= lt gt le ge not == != <=> eq ne cmp ~~ and xor There is no ( ) operator
  • 23. -> & ++ -- | ^ ** && ! ~ + - || // =~ !~ .. ... * / % x ?: + - . = += -= *= etc. << >> , => < > <= >= lt gt le ge not == != <=> eq ne cmp ~~ and xor There is no ( ) operator However there is a comma operator
  • 24. -> & ++ -- | ^ ** && ! ~ + - || // =~ !~ .. ... * / % x ?: + - . = += -= *= etc. << >> , => < > <= >= lt gt le ge not == != <=> eq ne cmp ~~ and xor There is no ( ) operator However there is a comma operator , That’s the operator
  • 25. The comma operator has a very low precedence, but it’s still an operator Parentheses ( ) are just there to modify precedence
  • 26.
  • 27. ( 1, 2, 3 ) is a list
  • 28. ( 1, 2, 3 ) is a list 1, 2, 3 is also a list
  • 29.
  • 30. my @list = 1, 2, 3
  • 31. my @list = 1, 2, 3 So why doesn’t this work ?
  • 32. my @list = 1, 2, 3 So why doesn’t this work ? That’s because = has greater precedence than ,
  • 33.
  • 34. my @array = 1, 2, 3;
  • 35. my @array = 1, 2, 3; is really
  • 36. my @array = 1, 2, 3; is really (my @array = 1), 2, 3;
  • 37. my @array = 1, 2, 3; is really (my @array = 1), 2, 3;
  • 38.
  • 40. And it’s also ( (my @array = 1), 2, 3 );
  • 41. And it’s also ( (my @array = 1), 2, 3 ); So it’s really a list ! We are just not looking at it completely when looking at @array
  • 42. Why is it useful to know ?
  • 43. It makes you realize you don’t need ( ) in many situations
  • 44.
  • 46. return 1, 2, 3; do_stuff or log(“error”), die;
  • 47. return 1, 2, 3; do_stuff or log(“error”), die; my $self = bless { }, $class;
  • 48. return 1, 2, 3; do_stuff or log(“error”), die; my $self = bless { }, $class; etc.
  • 49. return 1, 2, 3; do_stuff or log(“error”), die; my $self = bless { }, $class; etc. btw this doesn’t work
  • 50. return 1, 2, 3; do_stuff or log(“error”), die; my $self = bless { }, $class; etc. btw this doesn’t work do_stuff || log(“error”), die;
  • 51. return 1, 2, 3; do_stuff or log(“error”), die; my $self = bless { }, $class; etc. btw this doesn’t work do_stuff || log(“error”), die; => go learn your operators’ precedence
  • 52. So please don’t say that ( ) is the Perl 5 list operator: it is not Give more love to the comma operator, it’s often forgotten
  • 53. So please don’t say that ( ) is the Perl 5 list operator: it is not Give more love to the comma operator, it’s often forgotten ♥
  • 54. So please don’t say that ( ) is the Perl 5 list operator: it is not Give more love to the comma operator, it’s often forgotten ♥ And don’t listen to what people say...
  • 55. Thanks Damien Krotkine ( dams )

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n