Help for this page

Select Code to Download


  1. or download this
    sub add {
      return shift() + shift();
    }
    
  2. or download this
    sub add {
      return $_[0] + $_[1];
    ...
      my ( $left, $right ) = @_;
      return $left + $right;
    }
    
  3. or download this
    my $size = length( $some_string );
    
  4. or download this
    sub mylength {
      my $string = shift;
    ...
    my $length = mylength("Hello world.");
    
    # $length now holds 12.