FAQ Home to Cookwood Press
First and foremost, please consider this page permanently under construction. The more questions I get, and the more frequently I get them, the quicker I'll update the page. Hopefully, you'll find the answer to your question here. If not, try posting a message to my Question and Answer board.

When I call a script, instead of being executed, it's just shown as is in the browser.
You have to upload your script to your server, which may be your ISP or a local, personal server (like Sambar or Microsoft Personal Web Server). There are detailed instructions on how to do this in the second edition of my Perl and CGI book.

Can I test scripts on my local computer?

Yes, you definitely can. But you have to have a personal server, like Xitami or Sambar, or even the ones from Microsoft or Apple. The Xitami and Sambar servers include Perl (the interpreter) so you don't have to download it from the Perl site. Again, see the second edition of my book for more details on testing scripts locally.

What should the shebang line look like on non-Unix servers?
The shebang line on Unix servers shows where the perl interpreter can be found on the server. While it's not strictly necessary on Macs and Windows servers, it is still often used (and should still reflect the location of the perl interpreter). For more details, see page 35 in the second edition of my book.

Where can I get the subparseform.lib script?
The subparseform.lib script that is used by most of the scripts in the first edition of the book can be found in Appendix A (with explanations) and can be downloaded from the Examples page (along with the rest of the scripts and HTML code used in the book).

The subparseform.lib script doesn't seem to work with special characters...
This one has been hard for me to solve, because it always works in my tests on my server. However, as Robert Neville so kindly pointed out:

In your book you give an example library function that parses input that is incoming from a form. I noticed however that it doesn't handle special characters very well (like $@<>, etc.). So...I did some searching on the web about the pack function that you used and I think I might have found a slightly better way to write your parseform sub routine. Instead of using :

$key =~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C", hex($1))/eg;


$key =~ s/%(..)/pack("c",hex($1))/ge;

This way it matches any character and packs it using a signed value (lower-case c instead of C for unsigned).

Can I ask you a question directly?
The easiest way for me to help is if you post your questions to my Question and Answer board. That way, if someone else can answer the question for you, I can save time and write more books. I get a lot of e-mail, and I love every bit of it, but I also try to spend some time with my kids now and again (and work, don't forget work). So, if you write me, please know that I read everything and I will try to respond as soon as I can, but that I'm not always able to get back to you right away.

Now, if you've found an error in the book, have a suggestion, or other comments, you can still always reach me. Thanks.

©Copyright 1999, 2001 by Elizabeth Castro. All rights reserved.
Please don't copy this page. Instead, link to it! Thanks.

This FAQ is for my book, Perl & CGI for the World Wide Web: Visual QuickStart Guide, published by Peachpit Press.