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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:57:24+00:00 2026-06-06T18:57:24+00:00

I recently noticed that on my system it is not possible to require ‘lib/file.pl’

  • 0

I recently noticed that on my system it is not possible to require 'lib/file.pl' when running under -T, but require './lib/file.pl' works.

$ perl -wT -e 'require "lib/file.pl";'
Can't locate lib/file.pl in @INC (@INC contains: /usr/lib/perl5/site_perl/5.14.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.14.2 /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.14.2 /usr/lib/perl5/5.14.2/x86_64-linux-thread-multi /usr/lib/perl5/5.14.2 /usr/lib/perl5/site_perl/5.14.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.14.2 /usr/lib/perl5/site_perl)

$ perl -wT -e 'require "lib/file.pl"'

Doing it without -T works in both ways:
$ perl -w -e ‘require “lib/file.pl”‘
$ perl -w -e ‘require “./lib/file.pl”‘

In taint mode, . is not part of @INC.

perl -w -e 'print "@INC"'
[..snip..] /usr/lib/perl5/site_perl/5.14.2 /usr/lib/perl5/site_perl .
perl -wT -e 'print "@INC"'
[..snip..] /usr/lib/perl5/site_perl/5.14.2 /usr/lib/perl5/site_perl

I could not find that behavior in the doc. Can someone please tell me where this is documented or why -T doesn’t like . as a lib directory?

  • 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-06T18:57:25+00:00Added an answer on June 6, 2026 at 6:57 pm

    Erm… this is actually well documented, I suppose:

    When the taint mode (-T ) is in effect, the “.” directory is removed
    from @INC , and the environment variables PERL5LIB and PERLLIB are
    ignored by Perl. You can still adjust @INC from outside the program by
    using the -I command line option as explained in perlrun.

    … but that’s only a half on an answer, I suppose. The reasons behind such decision are given here:

    … the issue with @INC is really more of a problem with SUID scripts
    than CGI scripts. When you have an SUID script that can execute with
    the permissions of another user (such as root), Perl goes into
    taintmode automatically.

    For this SUID script case, it would be a huge security breach to have
    the capability of loading libraries from the user’s current directory.
    If a script ends up having a bug where the library is not found in the
    normal directory path, then a user could exploit this by writing their
    own, malicious version of the library, putting it in the current
    directory, and running the SUID script from their current directory.

    However, this is not really the same problem with CGI scripts. User’s
    are not executing your script from arbitrary directories. Your web
    server controls which directory the script is called from. So keeping
    “.” in @INC is not really a problem compared to SUID scripts which
    operate under taint mode automatically.

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

Sidebar

Related Questions

I have never come across this issue but most recently I noticed that a
I recently noticed that my installer (VS 2008) does not remove the DLLs during
I recently noticed that some (not all) of my javascript and jQuery scripts wouldn't
I have recently noticed that stack overflow for security reasons does not allow framing.
I have recently noticed that inside the collection objects contained in System.Collections.Concurrent namespace it
Hi I have recently noticed that when Running the function geoCoder.getFromLocationName() on android 2.2
I recently noticed that the file encoding of the pages I create in my
I recently noticed that colors are now displaying darker on iPhone than their actual
I've recently noticed that things accommodate differently on the simulator and a real device
I have recently noticed that a lot of JavaScript files on the Web start

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.