develooper Front page | perl.perl5.porters | Postings from October 1999

[ID 19991029.004] Correct documentation of require's handling of %INC

From:
M.J.T. Guy
Date:
October 29, 1999 10:39
Subject:
[ID 19991029.004] Correct documentation of require's handling of %INC
Message ID:
E11hFzT-0000SK-00@ursa.cus.cam.ac.uk
Jim Williams <james.p.williams@usahq.unitedspacealliance.com> has
pointed out on c.l.p.moderated the following correction for the
documentation of how 'require' handles %INC.


Mike Guy

--- ./pod/perlfunc.pod.orig	Wed Oct 13 17:13:36 1999
+++ ./pod/perlfunc.pod	Fri Oct 29 17:35:20 1999
@@ -3411,15 +3411,16 @@
 	    foreach $prefix (@INC) {
 		$realfilename = "$prefix/$filename";
 		if (-f $realfilename) {
+                    $INC{$filename} = $realfilename;
 		    $result = do $realfilename;
 		    last ITER;
 		}
 	    }
 	    die "Can't find $filename in \@INC";
 	}
+        delete $INC{$filename} if $@ || !$result;
 	die $@ if $@;
 	die "$filename did not return true value" unless $result;
-	$INC{$filename} = $realfilename;
 	return $result;
     }
 

End of patch



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About