use LWP::UserAgent;
use HTTP::Cookies;
use WWW::Mechanize;


my $start_page = 'https://secure2.playboy.com/security/loginStart.do?s
+c_target=cyber.playboy.com';
my $mech = WWW::Mechanize->new();

my $mech = WWW::Mechanize->new( cookie_jar =>  "lwpcookies.txt");
my $mech = WWW::Mechanize->new( agent=>"Mozilla/5.0 (X11; U; Linux i68
+6; en-US; rv:1.7) Gecko/20040918 Firefox/0.9.3 " );


$mech->get( $start_page );

if ($mech->success()==1) {
        print "Success \n";
        }

$mech->submit_form(
        form_name => 'loginForm',
        fields    => {
                username  => 'xxxx',
                password  => 'xxxx',
                savedPWAction => 'on',
                submitButton => 'ENTER THE CLUB'
        }
);
#$mech->click_button(name => 'submitButton');
#$button='submitButton';

$mech->click;

$result = $mech->success();

if ($result == 1){
        print "Success";
        }
else {
        print "Fail";
        }