Thu Jan 21 22:12:49 2010: Request 53902 was acted upon.
Transaction: Ticket created by SWMCD
       Queue: PAR-Packer
     Subject: The coderef in @INC returns a globref for non-existent files
   Broken in: 1.002
    Severity: Normal
       Owner: Nobody
  Requestors: sw...@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=53902 >


pp installs a coderef in @INC.
The func/require POD says of this coderef

    The subroutine should return undef or a filehandle,
    from which the file to include will be read. 
    If undef is returned, 
    require will look at the remaining elements of @INC.

However the coderef installed by pp always returns a filehandle
(actually, a globref), even if the require'd file doesn't exist.

There are programs that depend on the documented behavior.
For example, log4perl explicitly walks @INC looking for require'd files.
It tests the return value of coderefs on @INC to decide whether a
file exists; if it doesn't, it tries to require it under a different name.

When the coderef returns a globref for a file that doesn't exist,
this mechanism in log4perl breaks.

Reply via email to