WWW::Mechanize-Question

Posted by sid_com on Stack Overflow See other posts from Stack Overflow or by sid_com
Published on 2010-03-27T16:33:25Z Indexed on 2010/03/27 16:43 UTC
Read the original article Hit count: 577

Filed under:
|

Hello! Are both of these versions OK or is one of them to prefer?

#!/usr/bin/env perl
use strict;
use warnings;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new();
my $content;

# 1
$mech->get( 'http://www.kernel.org' );
$content = $mech->content;
say $content;

# 2
my $res = $mech->get( 'http://www.kernel.org' );
$content = $res->content;
say $content;

© Stack Overflow or respective owner

Related posts about perl

Related posts about www-mechanize