Take a look at the WWW::Mechanize module. The documentation covers filling in and submitting forms on webpages.
This has been covered many times in the past. A Super Search before posting never goes a miss.
Hope this helps.
Martin
Comment on Re: how to automate logins into password protected sites