Help for this page

Select Code to Download


  1. or download this
        > It calls your sub with $a and $b set to the first two
        > elements of the array which is neater in some ways,
        > but would make it harder to write the factorial example
        > above.
    
  2. or download this
        sub factorial {
            reduce { $a * $b } 1..$_[0]
        }