You are using a browser which doesn't fully support Cascading Style Sheets. This site will look much better in a browser that supports web standards, but its content is accessible to any browser or Internet device.

CPAN links

In the Perl world CPAN is the source of modules. To search for a module, sites like search.cpan.org help a lot.

Now, when mentioning a Perl module in your document, it makes sense to give direct access to the package. Given that each distribution A::Dist can be found under a link http://search.cpan.org/dist/A-Dist (with all double colons in a package name replaced by hyphens), in PerlPoint we can write

   ... the distribution
   \L{url="http://search.cpan.org/dist/PerlPoint-Package"}<PerlPoint::Package> ...

To open the link in a new window, this could be extended to

   ... the distribution
   \L{url="http://search.cpan.org/dist/PerlPoint-Package" target=_blank}<PerlPoint::Package> ...

which is a fairly long expression. For a typical Perl text mentioning lots of modules this is a lot of overhead - but it can be reduced significantly by a macro.

As we have to do a substitution this macro will use embedded Perl. Here is an suggestion (remove the newlines when copying):

    +CPAN:\EMBED{lang=perl}
             (my $b='__body__')=~s/::/-/g;
             qq(\XO<__body__>\C<\L{url="http://search.cpan.org/dist/$b/" target=_blank}<__body__>>);
          \END_EMBED

The macro does all the necessary work: it substitutes double colons by hyphens and constructs a link to the distribution page that opens in a new window. Additionally, it formats the module name as code and transparently adds an index entry for it.

With this definition, now a module can be mentioned quickly:

    ... the distribution \CPAN<PerlPoint::Package> ...

The only restriction is that the PerlPoint converter runs with option -active to enable Active Contents, otherwise embedded Perl (and thus the \CPAN macros) will be ignored.