Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 taking refuge in the Monastery: (15)
As of 2014-07-31 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls