use Win32::OLE qw( EVENTS in with valof ); use Win32::OLE::Variant; Win32::OLE->Option( Warn => 0 ); $HomePage = "http://www.greyhats.org/new/"; $IE = Win32::OLE->GetActiveObject( 'InternetExplorer.Application' ); if( ! defined $IE ) { print "Can not find open object. Creating one...\n"; $IE = Win32::OLE->new( 'InternetExplorer.Application', "Quit" ) or die "Unable to create a IE Object\n"; } Win32::OLE->WithEvents( $IE, \&cleanExit, 'DWebBrowserEvents2' ); $IE->{Visible} = 1; $IE->{RegisterAsDropTarget} = 1; $IE->{RegisterAsBrowser} = 1; $IE->Navigate( $HomePage ); # Let IE load the page while( $IE->{Busy} ) { while ($IE->SpinMessageLoop()) { select undef,undef,undef,0.25; } } $Doc = $IE->{Document}; $forms = $Doc->{forms} or die "Unable to retrieve forms"; $form = $forms->item("log_form") or die "Unable to find my form"; $elements = $form->{elements} or die "Can't get the elements"; $login = $elements->item("login",0) or die "Where is my login !?"; $pass = $elements->item("pass", 0) or die "I wonder why there isn't a pass"; $go = $elements->item("go", 0) or die "I want my button"; $login->{value} = "zejames"; $pass->{value} = "test"; $go->click; # Do whatever you want. sub cleanExit { my( $obj, $event, @args ) = @_; if ($event eq "OnQuit") { print "Terminating\n"; undef $obj; exit(1); } }