summaryrefslogtreecommitdiffstats
path: root/t/fun/anon.t
blob: 88b699180d2fbe8026a780a7088a338de8e7cce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use lib 't/fun/lib';

use Fun;

my $fun = fun ($x, $y) { $x * $y };

is($fun->(3, 4), 12);

my $fun2 = fun ($z, $w = 10) { $z / $w };

is($fun2->(60), 6);

done_testing;