Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Proposal - Update shortcuts pointing to to link to

by marto (Bishop)
on Jun 03, 2014 at 11:07 UTC ( #1088386=monkdiscuss: print w/replies, xml ) Need Help??

In recent weeks has been frequently unreliable including but not limited to 503 responses or no response at all. Could we update the relevant shortcuts to link to For the unaware What shortcuts can I use for linking to other information? lists which shortcuts currently link to I believe ambrus has already provided a patch for this. Thanks ambrus.

Update: typo fixes.

Update 31/07/2014: are now using for the search on the homepage, rather than

  • Comment on Proposal - Update shortcuts pointing to to link to

Replies are listed 'Best First'.
Re: Proposal - Update shortcuts pointing to to link to
by LanX (Chancellor) on Jun 03, 2014 at 11:44 UTC
    We had a similar discussion last year and I wrote a nodelet hack which automatically redirects such links, so I'm not affected.

    But seems like I never published it...

    I can do it later if anyone is interested (?)

    Cheers Rolf

    (addicted to the Perl Programming Language)

      I'd be interested to see that. However this only solves the problem for those who would use your nodelet hack, those without accounts can't use it even if they wanted to. In the interests of side stepping this issue for everyone I still think this should be changed. Thanks.

        Here we go

        <!-- ========================== PM LINK FIXER ========================== --> <!-- please disable after successful testing --> <h5> Testlinks </h5> [cpan://Data::Dump] <p> [mod://Data::Dump] <p> [|] <p> <script><!-- /* redirect links - avoid log out: redirect perlmonks domains to current one! - cpan -> metacpan */ (function (do_log){ var log = function (html){ if (do_log) document.writeln(html); } var fixes=''; var doc_host=document.location.hostname; for (var i in document.links) { var link_host = document.links[i].hostname; var link_href = document.links[i].href; var link_search = document.links[i].pathname; var link = document.links[i]; /* redirect links from other perlmonks domains to current one! * +/ if ( link_host && link_host != doc_host && link_host.match(/^(www\.)?perlmonks.(org|net|com)$/) ) { fixes += '<li> #'+i+' was '+link_host+'</li>\n'; document.links[i].hostname = doc_host; } /* redirect links from cpan to metacpan */ if ( link_host && link_host == '' ) { fixes += '<li> #'+i+' fixing '+link.href+'</li>\n'; if ( link.pathname == '/perldoc' ) { link.hostname = ''; link.pathname = '/module/'+'?')[1];''; link.protocol='https:'; } else if ( link.pathname == '/search' ) { link.hostname = '';'?q''&query')[1]; } } } if (fixes) { log('<h5>Fixed Links</h5><small><ol>'); log(fixes); log('</ol></small>'); } })(true); --></script>

        Logging and Testlinks should be disabled after successful testing.

        Cheers Rolf

        (addicted to the Perl Programming Language)

        > those without accounts can't use it even if they wanted to.

        Hmm , actually only those who don't have JS enabled.

        The monastery should have a general JS file.

        Though I'm not sure about the best way to make it a voluntary feature, maybe with cookies?


        Please note that this approach fixes ALL links, not only monastery markup but also plain links. Both within posts and chatterbox.

        Cheers Rolf

        (addicted to the Perl Programming Language)

Re: Proposal - Update shortcuts pointing to to link to
by davido (Archbishop) on Jun 03, 2014 at 19:00 UTC

    Given that there are shortcuts both for, and for, I prefer to trust that the author of a node chose the shortcut that he intended to use. Altering shortcuts en masse seems like bulk alteration of authors' semantic intent.

    I understand that provides a lot more in the way of nifty-widgets, but its response time also seems slower on average (excluding exceptional events such as downtime). When an author selects a shortcut she or he could be making that intentional decision with a knowledge of each site's advantages and disadvantages.


      Please keep in mind that cpan-links are more "handy" which might also explain their popularity.

      I can't see the problem to redirect while cpan is down, dead links are not in our interest...

      But IMHO the last decision should be done by the reader not the author nor the monastery.

      So its rather a question of managing user settings and a global flag.

      Cheers Rolf

      (addicted to the Perl Programming Language)


      I'm inclined to agree with davido on this. I think it's safe to say, Everybody loves choice. Removing/changing en masse i think violates POLA. Ultimately causing unnecessary disappointment.

      Do note; I completely understand your bringing this subject up again, marto, and at first, I felt inclined to agree. But after more thought. I think that while seemingly very helpful. Ultimately, maybe not the best solution.

      Is it possible to perhaps create a banner on PM. For those days that the search CPAN, starts acting up? Could something like that be done, with relative ease? Or better, does anyone know why this happens so often? Really, with all the Perl people here. Someone must have a bit of insight.


      λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

        I share these opinions.

      Thank you for your reply.

      Sadly the SiteDocClan didn't have enough foresight to declare in advance that cpan:// links to whatever interface is best to read CPAN, and doc:// links to whatever interface is best to read perldoc. Maybe you're right and this is too late to change now. Next time we add a new shortcut, we should declare this kind of freedom. Afterall, if you want links on a particular website, you could use a direct url.

      Update: let me note that my patch would also add new shortcuts to explicitly link to, namely searchcpan:// searchdist:// searchmod://. I volunteer to document these changes to What shortcuts can I use for linking to other information? and How do I link to modules on CPAN? if the patch is applied.

Re: Proposal - Update shortcuts pointing to to link to
by tangent (Priest) on Jun 03, 2014 at 21:34 UTC
    Might be a bit clumsy but could there be a [metacpan] next to each link. Personally I much prefer the metacpan pages.

      Personally, I like the idea of having a primary link to CPAN and secondary link to metaCPAN. I might be old-fashioned and prefer CPAN, but I admit that the recent amount of downtime for CPAN is annoying.

      You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

      That seems like a reasonable idea to me. If the links are convertible, it could go both ways even: EG cpan(mcpan) and mcpan(cpan).

Re: Proposal - Update shortcuts pointing to to link to
by Anonymous Monk on Jun 03, 2014 at 23:56 UTC
      > but I doubt it takes into anchors, and the anchors between and aren't portable

      Why exactly are deep links not portable?

      For example this Data::Dump#CONFIGURATION translates w/o problems.

      Please elaborate further!

      Cheers Rolf

      (addicted to the Perl Programming Language)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://1088386]
Front-paged by Arunbear
[zentara]: Corion in this cased they left the www. out
[zentara]: /d// :-)
[LanX]: i like tk, just joking. but what about modern styles?
LanX has to run. .. o/
[zentara]: modern styles are secondary to display readability. Tk is automatically good at the clunky industrial theme. :-)
[ww]: Amen!

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-05-26 12:45 GMT
Find Nodes?
    Voting Booth?