#!/usr/bin/perl use HTTP::Cookies; use WWW::Mechanize; use strict; use warnings; use diagnostics; use LWP::Debug qw(+); #Shows the transaction taking place my $start_page = 'https://secure2.playboy.com/security/loginStart.do?sc_target=cyber.playboy.com'; my $mech = WWW::Mechanize->new( agent=>"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040918 Firefox/0.9.3 " ); my $cookie_jar = HTTP::Cookies->new(file => './lwp_cookies.dat', autosave => 1,); #Creating a cookie jar $mech->cookie_jar($cookie_jar); #Attaching cookie jar to the user agent i.e $mech $mech->get( $start_page ); if ($mech->success()==1) { print "Success \n"; } $mech->submit_form( form_name => 'loginForm', fields => { username => 'xxxx', password => 'xxxx', savedPWAction => 'on', } ); if ($mech->success()==1) { print "Success \n"; } print $mech->content(); my $member_gateway='https://secure2.playboy.com/gateway/gateway.do '; $mech->get($member_gateway); print $mech->content();