What is the preferred method of accessing WWW::Mechanize responses?
- by sid_com
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;