Ok, I have been working and reading on this all day.
I got the activestate install of perl on my system now.
I have libwww install (or so I think.)
I used PPM (Perl Package Manager) and I was able to find that I have libwww installed. Now I don't know where it is installed or how all these packages are suposed to work under windows. But I have found a libwww-perl.pkg and libwww-perl.ppd files as well as all the compiled files in a different directory.
However I don't know where all the .pl files are such as www.pl. They are all listed in the .pkg file yet no actual file on my computer.
I use the ppm upgrade command and it says that I have libwww installed.
This all leaves me a bit lost at where to go from here, due to the main problem.
At the libwww-perl page on CPAN I downloaded a testbot.pl file. Code at the end.
I run into problems with the require statements.
Can't locate www.pl in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at testbot.pl line 23.
The same error shows up all over the place whenever attempting to require a file that is suposed to be a part of the libwww-perl package...
Since I don't know where the files are how am I suposed to include them.
I am really interested in learning this stuff and I have been searching the web high and low, discussion boards and such, but all the information I get on this stuff is way out of my league in understanding. If you could offer any assistance in any way I would really appreciate it.
-mage-
code:
#!/usr/public/bin/perl
# $Id: testbot,v 1.2 1994/08/01 13:31:27 fielding Exp $
#-----------------------------------------------------------------
# This program tests the wwwbot.pl library and is based on the one
# written by Brooks Cutter.
#
# The program starts with the BASE URL equal to the current file directory.
# To change it, enter a URL prefixed with "base=", e.g,
#
# Enter a URL (^D to exit): base=http://www.ics.uci.edu/
#
# The program starts with the User-Agent equal to program name.
# To change it, enter a name prefixed with "ua=", e.g,
#
# Enter a URL (^D to exit): ua=MOMspider/0.20
#
# 20 Jul 1994 (RTF): Initial Version
# 31 Jul 1994 (RTF): Changed interface to wwwbot'allowed
#
#-----------------------------------------------------------------
if ($libloc = $ENV{'LIBWWW_PERL'}) { unshift(@INC, $libloc); }
require "www.pl";
require "wwwurl.pl";
require "wwwbot.pl";
require "dumpvar.pl";
$ua = $0; # Method = program name
$ua =~ s#^.*/([^/]+)$#$1#; # lose the path
&www'set_def_header('http', 'User-Agent', "$ua/0.1");
# Set up User-Agent: header
$pwd = ( $ENV{'PWD'} | | $ENV{'cwd'} | | '' );
$base = "file://localhost$pwd/"; # Set up initial Base URL
#-----------------------------------------------------------------
if ($#ARGV == 0) { # Quickie, one-line version
$url = &wwwurl'absolute($base, $ARGV[0]);
&test($url);
}
else { # Interactive version
print "Enter a URL (^D to exit): ";
while (<> ) {
chop;
if (/^base=(.*)$/) { $base = $1; next; }
if (/^ua=(.*)$/)
{
$ua = $1;
&www'set_def_header('http', 'User-Agent', $ua);
next;
}
$url = &wwwurl'absolute($base, $_);
&test($url);
}
continue
{
print "===========================================================\n";
print "Enter a URL (^D to exit): ";
}
print "\n";
}
exit(0);
#-----------------------------------------------------------------
sub test
{
local($url) = @_;
$delay = &wwwbot'visitable($url);
print "delay of $delay for $url\n";
if ($delay) { sleep($delay); }
$ok = &wwwbot'allowed($url);
print "$ok: $url\n";
&wwwbot'visited($url);
&dumpvar('wwwbot');
}
1;