Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Smart enough for Smart Match??? (was "Understanding ...Given/When" )

by LanX (Canon)
on Mar 04, 2010 at 15:53 UTC ( #826728=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     Most of the power comes from implicit smart matching:
     
        when($foo)
    ...
    is exactly equivalent to
     
        when($_ ~~ $foo)
    
  2. or download this
    #  $a $b Type of Match Implied Matching Code
    # ====== ===== ===================== =============
    ...
    #  Array Regex array grep grep /$b/, @$a
    
  3. or download this
     given (@a) {
        when (/abc/) {}
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-07-06 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls