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 8078237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:43:43+00:00 2026-06-05T15:43:43+00:00

Currently I am trying to use a bunch of custom perl modules, test.pm as

  • 0

Currently I am trying to use a bunch of custom perl modules, test.pm as one of them, within my Perl program with a WebUI. I am running it on a Windows 7 machine with Apache2 installed. When I run the program in cmd prompt by using perl test.pl, the program runs fine. However running it on Apache gives me this error.

[Wed Jun 13 16:23:32 2012] [error] [client 127.0.0.1] Can't locate test.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/www/hello2.pl line 7.\r, referer: http://localhost/ui_test.htm
[Wed Jun 13 16:23:32 2012] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at C:/www/hello2.pl line 7.\r, referer: http://localhost/ui_test.htm

I have used:

foreach $key (sort keys(%ENV)) {
  print "$key = $ENV{$key}<p> \n";
}

and under the path variable, I do see the folder of where all the modules are located. Is there somewhere else I should use to add to the Perl Path?

In addition adding use lib “C:\testpm\”; to my code only changes the @INC to

(@INC contains: C:\testpm\ C:/Perl/lib C:/Perl/site/lib .)

Is there something additional you need to do to add paths to run custom perl modules on an apache server?

Solution Based On Answer:
I found this to work the best. Within my httpd-perl.conf file, I added these lines:

<IfModule env_module>
    SetEnv PERL5LIB "C:\testpm;C:\testpm1;"
</IfModule>

(extended out with C:\testpm1 to show people with similar questions how to add even more module folders.)

  • 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-06-05T15:43:45+00:00Added an answer on June 5, 2026 at 3:43 pm

    use lib is good if you can add in setup file otherwise you will have to add it in every single perl script file.Rather than doing this, you can use PERL5LIB environment variable.

    @INC in perl doesn’t take value of PATH environment variable rather it can take from PERL5LIB environment variable.

    You can add SetEnv PERL5LIB path_to_modules_directory directive in your apache configuration.Your perl script will add this path at front of original @INC value while executing your perl script.

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

Sidebar

Related Questions

So i am running into a major issue. I am currently trying to use
currently i'm trying to use imagick to generate some images without saving them on
I'm trying to use sqlcmd on a windows machine running SQL Server 2005 to
I am currently trying to use AJAX in my application via jRails. I am
I'm currently trying to use the latest stable fmod ex in my project. I
I am currently trying to use this gem http://github.com/pengwynn/linkedin . Everything works fine (i.e.
I'm having trouble editing an XML file. I'm currently trying to use Nokogiri ,
What I am currently trying to do is use the Face API to detect
I am currently trying to research how to use Android with an existing java
I'm a beginner coder in Ruby and currently I'm trying to use this plugin:

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.