Holy Monks,

I have a 'website' that is documentation for a largish ColdFusion Intranet application I'm in charge of. Each page of the site is documentation for one page of the ColdFusion app. So there are 135 ColdFusion pages and thus 135 HTML doc pages. I would like to add a section to each HTML doc page that displays every ColdFusion page that links to the particular CFM page documented. I already have a section on each HTML page that shows all of the page that each CFM pages links to, but not which pages link to each individual page. An example would probably help:

ColdFusion pages:
a.cfm, b.cfm, c.cfm

Docs pages:
a.html, b.html, c.html

In a.html there's a section that says that a.cfm links to b.cfm and c.cfm. The perl code I want would tell me which pages link to b.cfm, in this case a.cfm. Repeat that operation for all 135 HTML pages.

I already know enough Perl to be able to open and parse HTML files. So my plan is to make a script that will search the 135 HTML files for all pages that link to a particular page and spit that list out. But it doesn't seem very elegant because I'd be searching the 135 pages 135 times, once for each page. I don't want you to hold my hand and write all the code for me, I'm just looking for general advice to point me in the write direction before I embark on this journey.

Janitored by Arunbear - retitled from 'I've climbed the mountain to speak with the Oracle.', as per Monastery guidelines


In reply to Checking links between web-pages by yacoubean

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.