in reply to Verifying Links in HTML

The pages I'm checking are static. I was attempting to use an array to keep track of visited links but then I was having problems when testing to see if the page was already in there, etc. Something wrong with my regular expressions. I think the hash will work better though. Thanx for your suggestions.

For a string comprised of "http://www.whatever.html/directory/" how would I right a regular expression that'd make this equivalent to "http://www.whatever.html/directory/index.html"? Essentially I'd like to do this so that it doesn't test the same file twice with different names.

Replies are listed 'Best First'.
(bbfu) Re2: Verifying Links in HTML
by bbfu (Curate) on Jun 14, 2001 at 10:45 UTC

    $string = 'http://www.whatever.html/directory/'; $string .= 'index.html' if(substr($string, -1) eq '/');

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.