Example 2-2. mod_perl_rules1.pl with shebang line
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl rules!\n";
Now make the script executable and readable by the server, as
explained in the previous section:
panic% chmod 0700 /home/stas/modperl/mod_perl_rules1.pl
The mod_perl_rules1.pl script can be tested from
the command line, since it is essentially a regular Perl script:
panic% perl /home/stas/modperl/mod_perl_rules1.pl
This should produce the following output:
Content-type: text/plain
mod_perl rules!
Make sure the server is running and issue these requests using a
browser:
https://localhost/perl/mod_perl_rules1.pl
If the port being used is not 80 (e.g., 8080), the port number should
be included in the URL:
https://localhost:8080/perl/mod_perl_rules1.pl
Also, the localhost approach will work only if the
browser is running on the same machine as the server. If not, use the
real server name for this test. For example:
https://example.com/perl/mod_perl_rules1.pl