#!/usr/bin/perl -Tw use diagnostics; use strict; use WWW::Mechanize; use HTTP::Cookies; my $mech = WWW::Mechanize->new; my $username = "Username1"; my $password = "Password"; use LWP::Debug qw(+); $mech->cookie_jar( HTTP::Cookies->new( file => "/home/xxx/Documents/Scripts/xxx/Cookie.txt", autosave => 1, ignore_discard => 1, ) ); my $url = "http://forum.xxx/index.php?page=identify&forum=xxx&option=identify"; $mech->get($url); $mech->set_fields( nick => '$username' , password => '$password' ) ; $mech->click( "Valider");