in reply to Re: Some Weird behavior with BerkeleyDB and WWW::Mechanize
in thread Some Weird behavior with BerkeleyDB and WWW::Mechanize
#!/usr/bin/perl -w use strict; use BerkeleyDB; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my %pageHash; tie %pageHash, "BerkeleyDB::Btree", -Filename => 'pageContents', -Flags => DB_CREATE, or die "Cannot open file pageContents: $! $BerkeleyDB::Error\n +" ; my %hash; tie %hash, "BerkeleyDB::Btree", -Filename => 'videoDB', -Flags => DB_CREATE, or die "Cannot open file videoDB: $! $BerkeleyDB::Error\n" ; foreach my $x (keys %hash) { print "getting $x:"; my $data = $hash{$x}; my @parts = split(/\t/, $data); my $url = $parts[0]; $mech->get( "$url" ); if($mech->success()) { #$pageHash{$x} = $mech->content( format => 'text' ); print " done\n"; } else { print " failed\n"; } sleep(15); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Some Weird behavior with BerkeleyDB and WWW::Mechanize
by moritz (Cardinal) on Dec 05, 2007 at 20:50 UTC | |
by downer (Monk) on Dec 05, 2007 at 20:53 UTC | |
by moritz (Cardinal) on Dec 05, 2007 at 21:34 UTC | |
by downer (Monk) on Dec 06, 2007 at 00:17 UTC | |
by Anonymous Monk on Dec 06, 2007 at 07:49 UTC |