#!/usr/bin/env perl use strict; use warnings; use WWW::Mechanize; my $start_url = 'start_url'; my $loginData = 'loginData'; my $loginUrl = 'loginUrl'; my $mech = WWW::Mechanize->new( show_progress => 1 ); my $req = $mech->post( $loginUrl, "Content-type" => 'application/x-www-form-urlencoded', "Referer" => $start_url, "Content" => $loginData ); print $req->content( format => 'text' );