<p dir="ltr">Are CPAN modules themselves case-insensitive? I wonder if PAUSE allows foo::bar and FOO::BAR.</p>
<p dir="ltr">I doubt that such conflicting modules exists though, but it&#39;s worthwhile to consider what this proposed metacpan API should do in the event of a collision.</p>
<div class="gmail_quote">On 20 Jun 2015 4:47 pm, &quot;SundaraRaman R&quot; &lt;<a href="mailto:sundaryourfriend@gmail.com">sundaryourfriend@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I&#39;d like to GET data on a module by its name, similar to what the<br>
/module/Module::Name endpoint does, except I would like to be able to<br>
specify the Module::Name as module::name or Module::name, etc. What<br>
would the easiest way to do this be?<br>
<br>
The usecase is, I&#39;m hacking on the MetaCPAN Instant Answer on DuckDuckGo<br>
(eg: <a href="https://duckduckgo.com/?q=metacpan+LWP%3A%3AUserAgent" rel="noreferrer" target="_blank">https://duckduckgo.com/?q=metacpan+LWP%3A%3AUserAgent</a>), which<br>
currently uses the /module/Module::Name form of API call internally.<br>
This gives the user some information about the current version of the<br>
module, as extracted from the API. It works if the user enters the<br>
module&#39;s name in the exactly correct case, but even a single letter<br>
being incorrect in case (eg: LWP::Useragent) leads to no result from the<br>
API. I&#39;d like to change this so that it works whatever case the user<br>
enters the module name is in.<br>
<br>
I noticed that there is a module.name.lowercase field, and got as far as:<br>
<br>
$ curl <a href="http://api.metacpan.org/v0/module/" rel="noreferrer" target="_blank">http://api.metacpan.org/v0/module/</a> -d&#39;<br>
{<br>
&quot;filter&quot;: { &quot;bool&quot;: { &quot;must&quot;: [ { &quot;term&quot;: { &quot;module.name.lowercase&quot;:<br>
&quot;lwp::useragent&quot; }}, {&quot;match&quot;: {&quot;status&quot;: &quot;latest&quot;}} ] } }<br>
}&#39;<br>
<br>
which seems to work, but I&#39;m unsure on (a) whether there is a simpler<br>
way of achieving this (b) whether the above would be sufficient to<br>
replicate what the /module/ endpoint does i.e. reliably getting the<br>
latest version of the module.<br>
<br>
An additional constraint (and further reason a simpler solution would be<br>
appreciated) is that the Instant Answers (AFAICT) support making only<br>
GET requests (without a BODY), no POSTs. So I believe the above would<br>
have to become a big encoded &quot;?source&quot; abomination if this was indeed<br>
the simplest way to achieve this. I&#39;m hoping that this is not the case!<br>
<br>
Cheers,<br>
Sundar<br>
<br>
_______________________________________________<br>
MetaCPAN mailing list<br>
<a href="mailto:MetaCPAN@lists.scsys.co.uk">MetaCPAN@lists.scsys.co.uk</a><br>
<a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/metacpan" rel="noreferrer" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/metacpan</a><br>
</blockquote></div>