• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Execute Perl .pl file on webpage?

edro

Lifer
How do I execute a .pl file in a webpage? If I go to the root directory now, then click on the file, it works.

I guess I could forward the URL to the actual file name...
 
take a look at the docs for mod_perl
In particular, on linux/apache, you need to load the mod_perl module with some code like this:

#
# Mod_perl incorporates a Perl interpreter into the Apache web server,
# so that the Apache web server can directly execute Perl code.
# Mod_perl links the Perl runtime library into the Apache web server
# and provides an object-oriented Perl interface for Apache's C
# language API. The end result is a quicker CGI script turnaround
# process, since no external Perl interpreter has to be started.
#

LoadModule perl_module modules/mod_perl.so

# This will allow execution of mod_perl to compile your scripts to
# subroutines which it will execute directly, avoiding the costly
# compile process for most requests.
#
Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlHandler ModPerl::Registry::handler
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

This is from the file /etc/httpd/conf.d/perl.conf on my RedHat 9 system, slightly edited for my sitation.

I'm just learning this stuff, so other inputs are appreciated. You should also be able to run it as a CGI program without mod_perl, but I don't know how to do that, and mod_perl is supposed to be much faster.
 
You don't NEED mod_perl at all.

How do you execute it? Just load up the URL of the script, if CGI is enabled on the webserver, it'll run.
 
This isn't a perl config issue, it's a http server issue. Assuming you are running apache, edit httpd.conf, look for a line like 'DirectoryIndex index.htm, etc...' add the filename you want served as an index to this line. Alternatively, and probably better, is to do this in a .htaccess file in the dir.
 
Back
Top