sub __mechanize_http { $win = @_; $title = $win->{titleTxt}->GetValue(); #$win is the main window and titleTxt is the name of one of the text field. GetValue() will return the content of text field in WxString fromat. $commentfile = $win->{fileNameTxt}->GetValue(); #Wx::TextCtrl->GetValue() returns WxString. print "\nTitle: ",$title; print "\nOutput: ", $commentfile; my $url = "http://www.example.com/"; my $mech = WWW::Mechanize->new(autocheck => 1); $mech->agent_alias ( "Windows IE 6" ); $mech->get($url) or die "Can't even get $url: " . $mech->response->status_line unless ($mech->success); $mech->form_name('AddForm'); $mech->field(title => $title); $mech->field(commentfile => $commentfile); $mech->submit(); }