Re: WWW::Mechanize question

[email protected] (Gunnar Hjalmarsson)
Newsgroups perl.beginners
Message-ID <[email protected]>
Richard Lee wrote:
> what is wrong w/ below?
> I would think this would work but this is spitting out
> 
> use strict;
> use warnings;
> 
> use WWW::Mechanize;
> my $mech = WWW::Mechanize->new();
> my $url = 'http://10.212.100.1';
> 
> #$mech->credentials('user1', 'passwd1');
> my $page = $mech->get( $url );
> 
> print "$page\n";
> 
> when I run it, I get
> -> HTTP::Response=HASH(0x9e64f8c)

Please read the documentation for the module you are using.

http://search.cpan.org/perldoc?WWW::Mechanize#$mech-%3Eget%28_$uri_%29

You probably want:

     $mech->get( $url );
     print $mech->content;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.