It's surprising how far you can get in one day by starting with
use constant STARTING_URL => 'http://localhost//notyetbuilt.cgi';
my $agent = WWW::Mechanize->new();
ok( $agent->status, 200 );
and then writing just enough CGI code to make that first little test pass, and then by writing the next test, and then writing just enough code to make that pass, and so on. Tiny step by tiny step.
By the end of the day, what looked like two days of work is nearly done, with good functional test coverage. Add unit tests on the other side, as appropriate.
Replace Test with Test::Simple or Test::More as your preferences dictate.
A shout out to Andy for a fine piece of work on WWW::Mechanize, which made quick work of driving form development.