Simple
static code is stuff that stays the same.... html is a good example of static code.....
If you create a table in html it stays the same even if a user login or plays with a couple of drop down menus...
perl is a good example of dynamic code because on the server side, it can do alot of different stuff....
Say a user is playing with the drop down menus again....
perl can totally rewrite the webpage to show the results...
a comment form is a good example because if you happen to get to the submit page without filling out the comment form, you will get a processing error.... perl doesn't know what to give you back.... or it might rewrite the page code to redirect you to a help page..... Of even re-write a portion of the same page to to show you the help page embedded
or say if he happens to be on a comment form and we used a javascript to validate the form fields.... java would give you a bunch of errors on the page to help you along....
In short, you can do a lost of stuff, but it all depends on user experience..... the pages might be slow becuase you are doing a query in the backgound.... the query fails becuase some of the data is missing.....
if we validate the form before we submit, the user is kept busy completing the form, and the query would be fasters on submit because we wouldn't have to validate the data in the background.... it saves a step....
Hope this example helps....