Help for this page

Select Code to Download


  1. or download this
        use Switch;
    
    ...
            case (\&sub)    { print "arg to subroutine" }
            else            { print "previous case not true" }
        }
    
  2. or download this
        syntax (switch (EXPR) CODE) { # eval the expr first to avoid
                                      # reevaluation at each case
    ...
            SUB(EXPR)
          }
        }
    
  3. or download this
        parser = new Parse::RecDescent (q{
            expression: and_expr '||' expression | and_expr
    ...
            brack_expr: '(' expression ')'       | identifier
            identifier: /[a-z]+/i
            );