I'm working on a similer project and I get no errors
on this, I'm not sure why its not working for you.
I've formated the code a bit differtly, but nothing
has changed really.
#!/usr/bin/perl -w
#url_touch.pl program file
use strict;
use LWP::Simple;
my $url = $ARGV[0];
my $url_head;
my @list;
foreach $url_head(head($url))
{
$url_head = "Not Given" unless defined $url_head;
push( @list, $url_head);
}
my ($content_type, $document_length, $modified_time, $expires, $server
+) = @list;
print ">>$content_type<< ";
print ">>$document_length<< ";
print ">>$modified_time<< ";
print ">>$expires<< ";
print ">>$server<<\n";
--- END_OF_FILE
I do know that you have to use a fully qualifed URL
for this to work
work. www.webadept.net/index.html won't work, I have to use the
http://www.webadept.net/index.html for it to work.
here is the command and output...
tigger$ perl url_touch.pl http://www.cjsportscards.com/index.html
>>text/html<< >>13168<< >>982047528<< >>Not Given<< >> ConcentricHost-Ashurbanipal/2.0 (XO(TM) Web
Site Hosting)<<
Hope this helps..
Glenn Hefley
www.lucidmatrix.com
|