On Thu, 10 Jul 2003 15:40:56 -0700, charu wrote:
> can anyone please guide me as to where i am going wrong.
> hopign for some geek to help me soon

Hello charu,

        the script that you wrote had some problems.

        You might want to use the following modules every time you write 
scripts until you are very good at it:

                warnings
                diagnostics
                strict

        You also might want to use the Data::Dumper module, because it gives 
you a way to print out data structures.

        And last but not least: You don't get anything back from your last 
line because there is no 'server' field in the http header.

Example:

#!/usr/bin/perl
 
use warnings;
use diagnostics;

use strict;

use LWP;
use Data::Dumper;

my $agent = LWP::UserAgent->new();
my $response = $agent->get("http://www.yahoo.com";);
print Dumper ($response); 

# This line doesn't work because there is no 'Server' field 
# in the hash $response reference is pointing to.
#  print $response->header("Server"),"\n";

thanks
/oliver/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to