Charu wrote:
> i am a beginner to this world of perl. i am not able to  run my
> script using the LWP package.
> i couldn't  figure out what was the error.
> can anyone  tell me where  to save the  file and how to open it
> precisely. i ma using Windows 2000 (can i use IIS as the server?) .
> Also, does the LWP package requires the perl script to be uploaded
> on a server??.
>
> if this LWP module requires the script to be uploaded on a server
> then can i use perl script on my  local machine to open a web page ?
>
> my script is as folows:
>
> #!E:/bin/perl -w
> use strict;
> use LWP;
>
>
> my $browser=LWP::UserAgent->new();
> my $response = $browser ->get("http://www.yahoo.com";);
> print $response->header("Server"),"\n";
>
> --EnD--
>
> can anyone please guide me as to where i am going wrong.
> hopign for some geek to help me soon

Hi Charu.

You aren't going wrong anywhere, except that there is no 'Server'
header. So your program correctly prints nothing (I presume?).
Look at this instead. And 'use warnings' unless you've a good
reason not to.

HTH,

Rob


  use strict;
  use warnings;

  use LWP;

  my $browser = new LWP::UserAgent;
  my $response = $browser->get('http://www.yahoo.com');

  print $response->header('Title'), "\n";

OUTPUT

  Yahoo!





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

Reply via email to