Help for this page

Select Code to Download


  1. or download this
    use v5.10;  
    use warnings;
    ...
        when( [ 6..10 ] ) { say "$_ : Matched 6 through 10" }  
        default     { say "$_ : Matched nothing" }  
    }
    
  2. or download this
    a : Matched an a
    Argument "z" isn't numeric in smart match at C:\b\perlmonks\switch.pl 
    +line 7.
    ...
    9 : Matched 6 through 10
    10 : Matched 6 through 10
    11 : Matched nothing