in reply to quote of the day

See the FAQ How do I select a random line from a file?. That algorithm is far more memory efficient then what you have. That said, usually the advice given is to use the CGI module. For a script this simple it probably isn't necessary, but it's a very good idea when you start wanting to parse parameters to your script. Also, when you start doing real CGI programming, you should use the -T flag. I wonder if you really want text/plain for your content type, and not text/html.

That said, when you had trouble with rand, what I think you should have done, is check out the documentation. There is plenty of documentation on this site, as well as elsewhere. Additionally, documentation comes with perl, in the form of the perldoc command, or HTML files with the (windows) ActiveState version. From the documentation it is fairly easy to rule out the methods you tried that failed. Don't guess on how something works; you can look it up.