#!/usr/bin/perl -w

use strict;
use WWW::Mechanize;

my $uri = shift or die "Must specify a URL or file to check\n";

my $mech = new WWW::Mechanize();
$mech->get( $uri );
$mech->success or die "Can't fetch $uri\n", $mech->res->status_line, "\n";

$mech->is_html or die "$uri returns type \"", $mech->ct, "\", not \"text/html\"\n";

for my $form ( $mech->forms() ) {
    print $form->dump;
    print "\n";
}

