Simple Question - LWP::Simple not accessing the internet 
Author Message
 Simple Question - LWP::Simple not accessing the internet

heres' my situation

winxp
perl 5.005_03 build 522 for windows

I try the following:

use LWP::Simple;
print "$LWP::Simple::VERSION \n";
unless (defined ($content = LWP::Simple->get("www.yahoo.org"))) {
    die "could not get it \n";

Quote:
}

print $content;
i get:

c:\perl prog.pl
1.32
could not get it
c:\

I know that the program hasn't accessed the 'net because my firewall
hasn't seen anything come through. Anyhelp is appreciated - thanks in
advance

Griffin



Wed, 13 Apr 2005 23:14:36 GMT  
 Simple Question - LWP::Simple not accessing the internet

Quote:

> heres' my situation

> winxp
> perl 5.005_03 build 522 for windows

> I try the following:

> use LWP::Simple;
> print "$LWP::Simple::VERSION \n";
> unless (defined ($content = LWP::Simple->get("www.yahoo.org"))) {
>     die "could not get it \n";
> }
> print $content;
> i get:

> c:\perl prog.pl
> 1.32
> could not get it
> c:\

> I know that the program hasn't accessed the 'net because my firewall
> hasn't seen anything come through. Anyhelp is appreciated - thanks in
> advance

The URL isn't correct, try:

use LWP::Simple;
print "$LWP::Simple::VERSION \n";
unless (defined ($content = LWP::Simple->get("http://www.yahoo.org"))) {
    die "could not get it \n";

Quote:
}

print $content;

John
--
use Perl;
program
fulfillment



Thu, 14 Apr 2005 06:37:06 GMT  
 Simple Question - LWP::Simple not accessing the internet

Quote:

> heres' my situation

> winxp
> perl 5.005_03 build 522 for windows

> I try the following:

> use LWP::Simple;
> print "$LWP::Simple::VERSION \n";
> unless (defined ($content = LWP::Simple->get("www.yahoo.org"))) {
>     die "could not get it \n";
> }

1)'LWP::Simple->get' won't work for me.
2)I need to prefix the website location with 'http://'

So, try:

$content = get("http://www.yahoo.com");

If that doesn't work try adding a trailing '/' to the location. Seems
to work for me both with and without it.

Cheers,
Rob



Thu, 14 Apr 2005 13:18:05 GMT  
 Simple Question - LWP::Simple not accessing the internet

Sisyphus> 1)'LWP::Simple->get' won't work for me.

It won't work for ANYONE.  That's a bad invocation, to invoke a
subroutine as if it was a method call, because the extra parameter
gets passed when it isn't expected.  Maybe you wanted LWP::Simple::get
or just import it and use "get".

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Fri, 15 Apr 2005 00:42:29 GMT  
 Simple Question - LWP::Simple not accessing the internet

Quote:

> Sisyphus> 1)'LWP::Simple->get' won't work for me.
> It won't work for ANYONE.

unless you define an lwp scheme :)

--

The Perl Review - a new magazine devoted to Perl
<http://www.theperlreview.com>



Fri, 15 Apr 2005 09:36:50 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Simple TCP client using io::socket::inet not so simple

2. use LWP::Simple not found?

3. use LWP::Simple not found?

4. Confused by LWP::Simple not returning undef...

5. XS - Simple answer to simple question?

6. Simple Question from a simple chap!

7. simple, simple question

8. Simple Unix Question, ( Simple for you maybe )

9. Simple simple question

10. LWP::Simple::get/HTACCESS Question

11. Simple Perl/LWP Question

12. Question on LIBWWW function LWP::Simple get subroutine.

 

 
Powered by phpBB® Forum Software