Help for this page

Select Code to Download


  1. or download this
    my %function = (
      sumsq => sub  { my $sum = 0; foreach(@_) { $sum += $_*$_; } return $
    +sum; },  # sum of squares
      sqrt => sub { return sqrt shift; },
    );
    
  2. or download this
        if(/\G((?i:[a-z]\w*))\s*\(/gc) {  # function '('
            my $function = $1;
    ...
            trace(sprintf "function '$function' called with %d argument%s"
    +, scalar @arg, @arg==1 ? "" : "s");
            return $function{$function}->(@arg);
        }
    
  3. or download this
    Line 29 "·sumsq(3,2+2)*sqrt(36)"
    Line 29 "sumsq(·3,2+2)*sqrt(36)"
    ...
    Line 45 "sumsq(3,2+2)*sqrt(36)·" result = 150
    150
    Stack: This value is never affected