Skip Menu |
 

This queue is for tickets about the Module-Load-Conditional CPAN distribution.

Report information
The Basics
Id: 116678
Status: new
Priority: 0/
Queue: Module-Load-Conditional

People
Owner: Nobody in particular
Requestors: PERLANCAR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Doesn't handle all cases of require hook?
Download (untitled) / with headers
text/plain 1.4k
The `require` section of perlfunc says: ... (e.g., "Foo/Bar.pm"). The subroutine should return either nothing or else a list of up to four values in the following order: 1 A reference to a scalar, containing any initial source code to prepend to the file or generator output. 2 A filehandle, from which the file will be read. 3 A reference to a subroutine. If there is no filehandle (previous item), then this subroutine is expected to generate one line of source code per call, writing the line into $_ and returning 1, then finally at end of file returning 0. If there is a filehandle, then the subroutine will be called to act as a simple source filter, with the line as read in $_. Again, return 1 for each valid line, and 0 after all lines have been returned. 4 Optional state for the subroutine. The state is passed in as $_[1]. A reference to the subroutine itself is passed in as $_[0]. ... It seems that check_install() only expects #2 (filehandle, $fh) from the hook. It doesn't handle the case when the source is being generated by #3 (subroutine), or a combination of #2 and #3 (where the lines from the filehandle might need to be filtered first by the subroutine).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.