You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$mech->content(raw=>1) dies when there is no current response, while $mech->content() simply returns undef.
Can you please make $mech->content(raw=>1) (and perhaps other variations that I haven't tested) return undef in such a case as well?
$ perl -MWWW::Mechanize -E 'my $mech = WWW::Mechanize->new; say $mech->content() // "(undef)";'
(undef)
$ perl -MWWW::Mechanize -E 'my $mech = WWW::Mechanize->new; say $mech->content(raw=>1) // "(undef)";'
Can't call method "content" on an undefined value at /opt/perl-5.38/lib/site_perl/5.38.0/WWW/Mechanize.pm line 335.
The text was updated successfully, but these errors were encountered:
That sounds like a reasonable change. I'd be interested to hear from @petdance. My main concern is that even innocuous changes tend to break things in the wild.
The docs do say:
A fresh instance of WWW::Mechanize will return undef when $mech->content() is called, because no content is present before a request has been made.
I guess it's not 100% clear if that means just content() or also content(...).
$mech->content(raw=>1)
dies when there is no current response, while$mech->content()
simply returnsundef
.Can you please make
$mech->content(raw=>1)
(and perhaps other variations that I haven't tested) returnundef
in such a case as well?The text was updated successfully, but these errors were encountered: