Following in the great tradition of computer science, here's a quick script you can use to test your mod_perl installation that spits back a webpage with the message "Hello, world".
To create this script, change directories
to the perl subdirectory of the main Apache directory and create a file
named hello.pl using your text editor of choice.
|
Insert the following Perl code into the
file:
|
Now open up a web browser, and take a peek at what the script does by going to the URL http://myhost.com/perl/hello.pl
The "Hello, World" message should appear in your browser window. If you refresh the page a few times, you'll notice that it loads a little faster than your average CGI script. (Granted, the speed difference isn't that noticeable with a script this small.)
If you want to try a script that's got
a little more meat to it, and at the same time verify that your CGI environment
is being replicated properly, you might want to try the printenv script
that ships with Apache. By default, this script is located in Apache's
cgi-bin directory. The below commands make a copy of the script in
the perl subdirectory and enable it.
|
You can see what this script generates by looking at the URL http://myhost.com/perl/printenv
Once you're done playing with this script, you'll probably want to delete it from the perl subdirectory just to be secure (it gives out a little too much information about your system to be safe).
Now you're ready to go - move your old CGI scripts over the the Apache::Registry directory, update your hypertext links, and watch your dyanmic pages move faster.