#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Test::More tests=>6; use Test::Exception; use Sub::Curried; curry add_n_to ($n, $val) { return $n + $val; }; isa_ok (\&add_n_to, 'Sub::Curried'); my $add_10_to = add_n_to(10); isa_ok ($add_10_to, 'Sub::Curried'); is( $add_10_to->(4), 14, "curried"); is( add_n_to(9,4), 13, "non-curried"); is( add_n_to(8)->(3),11, "chained curried call"); dies_ok { add_n_to(1,2,3); } 'Dies on too many parameters';