RosettaCodeData/Task/Function-composition/Perl/function-composition.pl
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

10 lines
153 B
Perl

sub compose {
my ($f, $g) = @_;
sub {
$f -> ($g -> (@_))
};
}
use Math::Trig;
print compose(sub {sin $_[0]}, \&asin)->(0.5), "\n";