projects
/
gitmo/Eval-Closure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
460a4d1
)
die if the source doesn't return a subroutine reference
Jesse Luehrs [Wed, 20 Oct 2010 20:13:40 +0000 (15:13 -0500)]
lib/Eval/Closure.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Eval/Closure.pm
b/lib/Eval/Closure.pm
index
1ce0327
..
e45cb98
100644
(file)
--- a/
lib/Eval/Closure.pm
+++ b/
lib/Eval/Closure.pm
@@
-59,7
+59,13
@@
sub _clean_eval_closure {
}
my $code = eval _make_source(@_);
- ($code, $@);
+
+ if (!ref($code) || ref($code) ne 'CODE') {
+ undef $code;
+ $@ = "The 'source' parameter must return a subroutine reference";
+ }
+
+ return ($code, $@);
}
sub _make_source {