Dilip Barman's Perl Project Proposal

Since we only have a week and a half or two to put together a project in perl, I am looking to program something that would be fun and have some value, but be a straightforward design. I initially came up with a web spider idea, but like the second idea better, that of providing stock analysis.

Proposal 1: Web Spider

My first proposal is to write a spider to check validity of links to a specified depth. I am sure that such tools exist, but I think it would be a useful exercise to write a small one myself. There would be two inputs: base URL and depth. Starting at the base, the HTML for that page would be parsed and a list of URLs linked to from that page would be generated. If depth is more than 1, this list building process would continue recursively to the given depth. The resulting list would have duplicates removed (I'm sure perl has handy string functions to do this) and be sorted alphabetically (again perl may have a built-in string or array sort, but if not this would be simple to write). For each item on the list, the program would simply try to fetch the URL page. A report would be generated showing all valid links and all invalid links found.

Proposal 2: Stock Analysis

Here I propose something much more fun and useful. What I'd like to do is provide a form eliciting input of stock ticker symbols. I would also give the option of sorting the output by one of a few metrics. My program would go to a quote server and parse the resulting data, looking for various fundamentals. I would then do some fundamental analysis calculations and present the data sorted as the user had asked.

Revision: Music Database

As I started working on the stock analysis program, I realized that this is more complex than I had initially realized. Either project proposed above requires essentially writing a mini-web client which can generate http requests, communicate them over the web, and interpret the html response. Interpreting the response would have been the heart of either proposal and perl's parsing capabilities would have been great. However, generating and communicating the http is not so easy. I did find a WWW Protocol Library for Perl and started looking at it, but decided to pursue another project.

I would like to practice the use of the unix DBM database management library, so thought I would design a database application. I picked a music database. Users will be able to query a database to find out what CDs exist for a particular genre, and will be able to contribute new items to that genre. Users will also be able to delete items found in the catalog. I would maintain the database as an associative array in a DBM file.

The database could be viewed as a community repository of music, so that there would be multiple database updaters. In a real implementation, there would need to be some security checking so that only authorized users could make database updates and deletions.


Return to home page
Execute the code
View implementation system notes

logo Background courtesy of Moyra's Web Jewels