Hi All
I had the following code to test what the head() method of the
LWP::Simple module returns.
#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
my $url = 'http://oreilly.com/store/complete.html';
#my $url = 'http://www.garimela.com/complete.html';
my $testvar = head($url);
print "head when used in scalar context is: $testvar \n";
print "Success \n" if ($testvar);
my @listvar = head($url);
print "head when used in a list context is: @listvar \n";
OUTPUT:
---------------
head when used in scalar context is: HTTP::Response=HASH(0x861cd00)
Success
Use of uninitialized value $listvar[3] in join or string at catalog.plx
line 15.
head when used in a list context is: text/html; charset=utf-8 462143
1288520055 Apache
My Questions:
-----------------------
1. From the module's documentation i can understand that the return
value of the head() method in a scalar context is TRUE , but what does
the value returned by the server which is HTTP::Response=HASH(0x861cd00)
signify ?
2. Why am i getting a warning message in the line 3 of the output ?
Thanks
Jatin
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/