- or download this
my $square_this
= sub { my $x = shift;
return $x**2;
};
- or download this
sub square
{
...
return $x**2;
}
my $square_this = \□
- or download this
my $squared = $square_this->($hypotenuse);
- or download this
package Square;
sub square
...
my $x = shift;
return $x**2;
}
- or download this
my $squared = square($hypotenuse);
- or download this
my $squared = Square::square($hypotenuse);
- or download this
use Square qw(square);
my $squared = square($hypotenuse);
- or download this
{ # closure for cubed
...
}
} # end closure for cubed