$ cpan WWW::Mechanize

or

 
$ cpan
cpan> install WWW::Mechanize

or

$ perl -MCPAN -eshell
cpan> install WWW::Mechanize