summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-01-04 18:41:14 -0600
committerJesse Luehrs <doy@tozt.net>2012-01-04 18:41:14 -0600
commit38311155f8bfb2ee335d4ac122ad148c83ea252e (patch)
tree1ad8c4dacc0a6cf26f7c01446cb4d3247273bbf5 /lib
parent96faf963aa8703449037aa46af1394a0e7831dc2 (diff)
downloadcircular-require-38311155f8bfb2ee335d4ac122ad148c83ea252e.tar.gz
circular-require-38311155f8bfb2ee335d4ac122ad148c83ea252e.zip
make this fix more general
Diffstat (limited to 'lib')
-rw-r--r--lib/circular/require.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/circular/require.pm b/lib/circular/require.pm
index 6a92b7b..3c65846 100644
--- a/lib/circular/require.pm
+++ b/lib/circular/require.pm
@@ -75,12 +75,11 @@ sub _require {
local $loaded_from{$string_file} = $previous_file;
local $previous_file = $string_file;
my $ret;
- # XXX ugh, base.pm checks against the regex
+ # ugh, base.pm checks against the regex
# /^Can't locate .*? at \(eval / to see if it should suppress the error
- # but we're not in an eval anymore... fake it for now, but this will
- # definitely break if some other module that overrides CORE::require tries
- # to do the same thing
- if (caller eq 'base') {
+ # but we're not in an eval anymore
+ # fake it up so that this looks the same
+ if (defined((caller(1))[6])) {
my $mod = _pm2mod($file);
$ret = $saved_require_hook
? $saved_require_hook->($file)