#!/usr/bin/perl -w use strict; use LWP::Simple; use HTTP::Request::Common; my @d; my ($stream, $file); my %list; my %cfg; $file = 'dave.cfg'; if ( -e $file ) { die "Failed: $! trying open existing $file\n" unless open FH, $file ; &getinfo; &buildhash; #&printboxes; &test; } else { print "Didn't find file\n"; die "Failed: $! trying to create new $file\n" unless open FH, '>'.$file; &buildhash; #&printboxes; } sub buildhash{ # This procedure gets the web page with the links to the comics and builds a # hash table consisting of the name of the comic as the key and the URL as the # value. # Get information from kingfeatures.com $stream = get('http://www.kingfeatures.com/features/comics/comicsNav.htm'); @d = split('\n',$stream); my $end = $#d-1; # This information is taken from the side menu for my $count(0..$end){ if ($d[$count] =~ m!name="(.+)">(.+)); close FH; } sub test{ my $key; foreach $key (keys %list){ print "Value is $cfg{$key}\n" if exists $cfg{$key}; } }