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