CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
How to tell if a file is reachable


New User

May 9, 2013, 6:14 PM

Post #1 of 5 (562 views)
How to tell if a file is reachable Can't Post

I have a homework assignment that doesn't make any sense to me. In the code block is what I'm given. I have never done scripting w/ webpages before, not really sure how to get started. The part I could use some pointers on is Part 2 in that I don't know how to tell if a "file" is reachable or not.
I have tried putting "wget" into my shell and a bunch of info about the site comes up, but not sure what do to with it.

Here is the writeup:

You have a web site containing static pages, such as and you wish to verify the site. 

Part 1: Static Verifier
Write an application called static_verifier that takes command-line arguments directory and a base URI (i.e. Uniform Resource Identifier, such as h_tp:// The application will scan all .html files in the directory and its subdirectories for <a> (anchor tags) and <img> (image tags) to find linked files.
For each link, determine whether it points to an internal (this site) or external resource. If it is internal, verify whether the file exists in your snapshot. Output should consist of the file name, the missing internal links, the valid internal links, and the external links. Indent each section. Within each section, list the names alphabetically so they will be diff-compatible with baseline data.

Sample Output (from modified index.html):

Missing Internal Links
Valid Internal Links
External Links

Part 2

Write a program called file_verifier that will take the same arguments as static_verifier.

Verify that each file in the subtree is reachable directly or indirectly from the the homepage (index.html). Print out the list of unreachable files in sorted order.


May 9, 2013, 6:54 PM

Post #2 of 5 (554 views)
Re: [vendetta1] How to tell if a file is reachable [In reply to] Can't Post

This is a cross post from stackoverflow, which I see your question on their has been closed.

(This post was edited by hwnd on May 9, 2013, 6:55 PM)

New User

May 9, 2013, 6:59 PM

Post #3 of 5 (551 views)
Re: [hwnd] How to tell if a file is reachable [In reply to] Can't Post

That was a vague question about part 1, this is part 2.

Veteran / Moderator

May 9, 2013, 7:12 PM

Post #4 of 5 (549 views)
Re: [vendetta1] How to tell if a file is reachable [In reply to] Can't Post

This question is also cross posted on devshed.

We can't/won't give you the solution to a homework assignment, but I will give you a hint.

Look at HTML::LinkExtor

New User

May 10, 2013, 12:05 PM

Post #5 of 5 (524 views)
Re: [FishMonger] How to tell if a file is reachable [In reply to] Can't Post

LinkExtor! that's what I needed. Thank you


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives