Skip Menu |

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

Report information
The Basics
Id: 7802
Status: open
Priority: 0/
Queue: Module-Info

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

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



Subject: Proposal for has_pod() function
A humble proposal for a has_pod() function returning 1 if the module/script has some pod imbedded, and 0 otherwise: =item has_pod $mod->has_pod() Returns true if pod documentation is detected within the module, false otherwise. =cut sub Module::Info::has_pod { my $self = shift; my $file; open $file, $self->file or return 0; # the file won't even open while( <$file> ) { return 1 if /^=[a-z]/; } return 0; }
This should also cope with the situation where a module has pod in a separate .pod file Maybe the function could return 0 if not pod was found, 1 for inline pod, and 2 for external pod. Then if you just care about whether there is any pod, the truthiness will do just fine. With appropriate constants defined for 1 and 2, of course.
Subject: Re: [rt.cpan.org #7802] Proposal for has_pod() function
Date: Sun, 25 Oct 2015 19:16:26 -0400
To: bug-Module-Info [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
On 2015-10-24 10:23 AM, Neil_Bowers via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=7802 > > > This should also cope with the situation where a module has pod in a separate .pod file > Maybe the function could return 0 if not pod was found, 1 for inline pod, and 2 for external pod. > Then if you just care about whether there is any pod, the truthiness will do just fine. > With appropriate constants defined for 1 and 2, of course. >
Neil, do you think you can tweak the CPAN PR challenge so that I get this module as my target for next month? ;-) `/.
Subject: Re: [rt.cpan.org #7802] Proposal for has_pod() function
Date: Mon, 26 Oct 2015 00:00:55 +0000
To: bug-Module-Info [...] rt.cpan.org
From: Neil Bowers <neil.bowers [...] cogendo.com>
Show quoted text
> Neil, do you think you can tweak the CPAN PR challenge so that I get > this module as my target for next month? ;-)
You might think so, but I couldn’t possibly comment.