Create an HTML form with appropriate fields for adding a stock item. Remember that the stock item's ID will be automatically filled in by the database, as it is an "auto increment" field. (A sample/answer form is available in your public_html directory as addstock.html)
Write a script which uses CGI.pm to accept the form's parameters, then creates an SQL query to add a record to the database. Output a message to the user indicating the success (or failure) of the operation. A sample script to get you started is available in public_html/cgi-bin/addstock.cgi
Check that the price is a number (use regular expressions for these checks)
Check that it has two decimal places
Check that the number of items in stock is a number
Output meaningful error messages in each case (a sample validation script was given as an exercise in the CGI Programming in Perl training module, and a sample script provided as validate.cgi. If you attended that training module, you may like to use the sample script as an outline for this exercise)