Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 81672
Status: new
Priority: 0/
Queue: Module-CoreList

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

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



Subject: Feature request: is_core() function
Download (untitled) / with headers
text/plain 905b
Having heard about this module, I expected to find a function something like: is_core($module_name); which would return true if the specified module is core for the currently running version of perl. It would take an optional second argument, which is a version of perl: is_core($module_name, $version); Here's the first pass at is_core, which I wrote for my first use of Module::CoreList: sub is_core { my $module = shift; my $version = @_ > 0 ? shift : $^V; return 0 unless defined(my $first_release = Module::CoreList::first_release($module)); return 0 unless $version >= $first_release; return 1 if !defined(my $final_release = Module::CoreList::removed_from($module)); return $version <= $final_release; } I don't know whether you can do those sorts of comparisons with versions, but I'm not specifying a version in my current usage :-)


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.