Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 894005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:18:42+00:00 2026-05-15T14:18:42+00:00

I have a script that’s written in perl, and executed as CGI. It works

  • 0

I have a script that’s written in perl, and executed as CGI. It works fine. Recently I have installed the mod_perl module into apache, and used the PerlModule ModPerl::Registry directive.

PerlModule ModPerl::Registry
PerlModule CGI
PerlSendHeader On

Alias /perl/ /real/path/to/perl/scripts/
<Location /perl>
SetHandler  perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
</Location>

<Files *.perl>
SetHandler  perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
</Files>

I’ve read that using this I do not need to modify my cgi perl code. (I always use strict pragma, so don’t worry about uninitialized global variables and stuff like that).

My original script still works as intended, except for one thing, files that I included with the require() function can no longer be resolved.

script.cgi:

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard Vars);
require "includes/functions.cgi";

#blah blah, more stuff

script.perl

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard Vars);
require "includes/functions.perl"; # <---- Returns error:  Can't locate includes/functions.perl in @INC
#blah blah, more stuff

The directory structure works like this:

$ ls

script.cgi script.perl includes/

$ ls includes/

functions.cgi functions.perl

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:18:43+00:00Added an answer on May 15, 2026 at 2:18 pm

    From: http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html

    META: document that for now we don’t chdir() into the script’s dir, because it affects the whole process under threads. ModPerl::RegistryPrefork should be used by those who run only under prefork MPM.

    so, if you’re using Apache2’s prefork MPM, you should try using ModPerl::RegistryPrefork. If you’re using worker, or event, or windows, you’re going to have to change your program to not assume that the cwd is the directory that that the perl is sitting in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that works fine when I run it manually in R
I have a script that works fine on my test server (using IIS6). The
I have script that add water mark (PNG, transparent) to image(JPG). Works fine with
I have a script that does graphing, using jqplot . It works fine when
I have CMS with a script that is executed for each file that is
I have a script that runs to upload an image, then resize it into
I have a script that I would like to convert to a module and
I have a script that write a iframe into the page. I want to
I have a script that, inserts into the database e.g. 20,000 users with email
Have a script that I can copy and run in mysql shell just fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.