From 38311155f8bfb2ee335d4ac122ad148c83ea252e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 4 Jan 2012 18:41:14 -0600 Subject: make this fix more general --- lib/circular/require.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3-54-g00ecf