Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

How should Perl CPAN modules be linked to in the text of answers on such that the people who follow the link (perhaps in the distant future) will always be taken to the latest stable version of that module?

Using a URL that always shows the latest stable version is important not only to ensure that everyone benefits from bug fixes, but also because old versions may actually be (and often are) deleted from CPAN.

share|improve this question

migrated from Aug 24 '09 at 22:02

This question came from our site for professional and enthusiast programmers.

Links to CPAN module distributions should be in this form:<module-distribution-name>/

where <module-distribution-name> should be replaced with the hyphen-separated module distribution name. Example:

And now an example inline: XML::Parser.

Links to individual modules should be in this form:<module-name><module-name>

where <module-name> should be replaced with the individual module name. Example:

Inline example: Rose::HTML::Form::Field.

share|improve this answer
May I recommend to update this answer using links to ? – szabgab Aug 24 '14 at 14:41

On another note, for short-hand linking to absolutely any Perl-related resource at all, you should take a look at

This is a redirector in the style of URL shortening services that was created by Juerd because he was envious of how easy made it to link to PHP resources during IRC discussions. But it goes a good deal above and beyond the features offered by its model – you can link to any one Perl function, the Perl docs, CPAN modules, or (using commas) even link to several of those at once. There are several predefined special links, and groups of links. The site also offers a pastebin.

Very handy for most of your Perl linking needs.

share|improve this answer

If you have the name of a Perl module, such as Net::MAC, you can tack it on to the end of the following URL stub:

So using the above example, this would become:

There are two advantages to using this method over others:

  1. You are taken straight to the manual page for the latest version of that module
  2. No need to substitute double-colons for hyphens

This second point is crucial if you want to set up a quick search in the Firefox web browser. For instance you could type "cpan Net::MAC" in the address/awesome bar and Firefox would be able to construct the URL as above.

Finally, here is a real link using the above example: Net::MAC

share|improve this answer
The disadvantage, however, is that people don't know what to do to not be on that page. That is, it's hard to tell what to do next. That's not a huge deal, but it's the reason I don't use this form. – brian d foy May 4 '10 at 21:48

John Siracusa wrote:

I think module distributions will most frequently be the unit of recommendation.

True, but the module’s documentation is usually more immediately useful than an overview over the contents of its distribution, and the distribution is just one click away from the documentation page. Also, much of the time you do not want to download tarballs via search.cpan anyway – you just want to browse docs and then use your preferred package manager to install, whether it be, Aptitude, ports, pkgsrc, PPM, or whatever.

That said, some larger distributions, eg. Moose, come with several different documentation pages, each of which will be useful to different parts of the audience, so in that case it seems preferable to link to the distribution and let each user pick whichever entry point they prefer, instead of linking to a specific one.

share|improve this answer

There's actually a distinction here that was not made clear in the original question. When linking to a module distribution on CPAN, you should use the form. When linking to an individual module within a distribution, use the form.

When recommending things from CPAN on StackOverflow, I think module distributions will most frequently be the unit of recommendation. After all, you don't download an individual ".pm" file from CPAN. What you download from CPAN are whole module distributions.

Nevertheless, it's good to know how to do both.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .