projects
/
gitmo/Moose.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
3726f90
)
add Sub::Exporter style caller() discovery
Chris Prather [Sun, 16 Sep 2007 13:48:34 +0000 (13:48 +0000)]
lib/Moose/Role.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moose/Role.pm
b/lib/Moose/Role.pm
index
2e6b187
..
55c283d
100644
(file)
--- a/
lib/Moose/Role.pm
+++ b/
lib/Moose/Role.pm
@@
-159,7
+159,12
@@
use Moose::Util::TypeConstraints;
});
sub import {
- $CALLER = caller();
+ $CALLER =
+ ref $_[1] && defined $_[1]->{into} ? $_[1]->{into}
+ : ref $_[1]
+ && defined $_[1]->{into_level} ? caller( $_[1]->{into_level} )
+ : caller();
+
strict->import;
warnings->import;