ç¶Sub::Spy
çµå±ãããªã¤ã³ã¿ãã§ã¼ã¹ã«ããã
use Sub::Spy qw/spy inspect/; my $subref = { $_[0] + $_[1]; }; my $spy = spy($subref); $spy->(1, 2); my $i = inspect($spy); $i->called; # 1 (true) $i->called_once; # 1 (true) $i->called_twice; # 0 (false) $i->threw; # 0 (false) $i->get_args(0); # [1, 2] $i->get_return_value(0); # 3 $i->get_call(0)->arguments; # [1, 2] $i->get_call(0)->return_value; # 3
http://github.com/zentooo/p5-sub-spy
ããã¨ãã¦ãæ©è½è¿½å ã§ãã¤ã³ã¿ãã§ã¼ã¹ãã以ä¸å¤ãããã ããã¨æã£ãã®ã§CPANã«ãããã¡ãã£ããã¡ãã£ã¨æ©ã¾ã£ãããã