I did notice if you mentioned this but make sure the file you are writing to has Read and Write on it. (gbook.txt). If you do a chmod 755 on the script it will only give the Internet user RX rights to it.
Also run your script with a -w where it says #!/usr/bin/perl -w and run it from the command line. Then it will show you any errors that it has with anything that you have done in the system.
Try using the CGI.pm (or CGILite.pm)module to get the information that has been posted/sent by the HTML document. Using a module will clean up your code and make it more understandable to debug.
--BigJoe
PS I actually tried to bring up gbook.txt as it shows in your script and there is none accessable to the Internet User in that location.