diff Lib/IMPL/require.pm @ 252:34a3f8668b58

fixed IMPL::require IMPL::declare
author sergey
date Mon, 19 Nov 2012 01:28:58 +0400
parents 9f394b27dccf
children 0f59b2de72af
line wrap: on
line diff
--- a/Lib/IMPL/require.pm	Fri Nov 16 16:44:16 2012 +0400
+++ b/Lib/IMPL/require.pm	Mon Nov 19 01:28:58 2012 +0400
@@ -17,6 +17,8 @@
 	
 	my $caller = caller;
 	
+	$PENDING{$caller} = 1;
+	
 	no strict 'refs';
 	
 	while( my ($alias, $class) = each %$aliases ) {
@@ -31,6 +33,8 @@
         
         $level--;
 	}
+	
+	delete $PENDING{$caller};
 }
 
 sub _require {
@@ -38,7 +42,7 @@
 
     if ( not $class =~ s/^-// ) {
         ( my $file = $class ) =~ s/::|'/\//g;
-        _trace("already pending") and return
+        _trace("already pending") and return $class
             if $PENDING{$class};
         $PENDING{$class} = 1;
         _trace("loading $file.pm");