Hello I am new to this forum.. I need help with perl

I have file called password.cgi

now on that page i have form with 2 txt field and 1 submit button

when i put new password and press submit i want new password to update on the database

Whole process needs to happen in same page

is there a way to execute the DBI sql when the form is submitted ?

Thanks in advance