diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-08-18 19:01:22 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-08-18 19:01:22 -0500 |
commit | 1e22f62b2c6bb17153f0524ea3a1b684346a8988 (patch) | |
tree | cd0f1f85b7e737df5eea19eebee67bc01584b2c4 /t | |
parent | 6d034593a5f0b02eb9e5b7069fa86814aae07b7c (diff) | |
download | fun-1e22f62b2c6bb17153f0524ea3a1b684346a8988.tar.gz fun-1e22f62b2c6bb17153f0524ea3a1b684346a8988.zip |
support anonymous functions
Diffstat (limited to 't')
-rw-r--r-- | t/anon.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/anon.t b/t/anon.t new file mode 100644 index 0000000..844fb97 --- /dev/null +++ b/t/anon.t @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Fun; + +my $fun = fun ($x, $y) { $x * $y }; + +is($fun->(3, 4), 12); + +done_testing; |