Short answer as to why this is failing: because Google really don't want you to do this, because they're smart, and because you're not the first person to try.
in reply to WWW::Mechanize cannot create new gmail account
If you want just one hint on doing things with WWW::Mechanize that websites really don't want you to do? Start by changing the User-Agent string so they don't know you're using WWW::Mechanize.
Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...