in reply to What is idiomatic use of WWW::Mechanize->new re: default headers?

WWW::Mechanize->new( autocheck => 1, cookie_jar => $cookie_jar, default_headers => HTTP::Headers->new( User_Agent => 'Mozilla/5.0 <snip>', Referer => 'https://www.<snip>', Accept => 'application/<snip>', Accept_Language => 'en-US,en;q=0.5', Accept_Encoding => 'gzip, deflate', Connection => 'keep-alive', ), show_progress => 1, );

Both the original version and this version look fine to me.

(User_Agent => ... and 'User-Agent' => ... can be used interchangeably in both snippets.)

Replies are listed 'Best First'.
Re^2: What is idiomatic use of WWW::Mechanize->new re: default headers?
by CoVAX (Beadle) on Feb 09, 2015 at 20:00 UTC

    I like your version much better than mine.

    Thank you!