Cleaning up my temp dir, I found the script I used to generate the link list (further edited) for [OT?] SCM recommendation for small to medium size Perl projects. I'd call it an overgrown -lp script and I wouldn't recommend people to do the same. Since it was meant to be a one shot only script some checks are appropriate for that particular situation and no more. In the same vein I used a sub with no proper parameter passing. But is is strict and warnings safe, so all in all it may be useful here for instructive purposes, especially since people routinely ask for ways to get web pages and parse HTML:

#!/usr/bin/perl -lpi.bak use strict; use warnings; use LWP::Simple; use HTML::TokeParser; sub get_title { my $doc=get $_ or warn "Couldn't get <$_>\n" and return; (my $p=HTML::TokeParser->new(\$doc)) ->get_tag('title') or return; $p->get_trimmed_text; } $_ or next; my $title; if (/wikipedia/) { $_=(split m|/|)[-1]; s/_/ /g; s/%(\w{2})/chr hex $1/ge; ($title=$_) =~ s/\s+\(.*?\)//; s|^|wp://|; } else { $title=get_title || 'NOT FOUND'; } $_="<li>[$_|$title]</li>"; __END__

In reply to Quick url list to PM links hack by blazar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.