#!/usr/bin/env perl
use strict;
use warnings;
use WWW::Mechanize;

my $username = '0039xxxx';
my $password = 'yyyyy';

my $m = WWW::Mechanize->new();

my $rc = $m->get('http://10.62.15.254/loginuser');

$rc = $m->submit_form(
  form_number => 0,
  fields => {
    Username => $username,
    Password => $password,
  },
);

if ( $rc->decoded_content !~ /Login successful/i) {
  print "Logged in.\n";
} else {
  warn "Not logged in? Content:", $rc->decoded_content;
}
