LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-07-2005, 12:05 PM   #1
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Perl: changing @INC after installation


Does anyone know if it possible to change the @INC path after installation of Perl?

I know I can use environment variables, but these are limited to single-user logons - and I can use -I flags, but this is limited to individual scripts; I'm really looking for a global change that will add my own directory (somewhere under /opt probably) to the include path.

Does anyone know more than me? And just out of interest, where is @INC stored anyway?

Many thanks for your help,

Robert J. Lee
 
Old 11-08-2005, 05:12 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Original Poster
Rep: Reputation: 76
Re: Perl: changing @INC after installation

OK; I've found the answer, and it looks like I can't.

@INC is set at configure time, and hard-coded into the /usr/bin/perl binary (although it seems that the Windows version derives at least one path from the installed location of the program).

@INC gets appended to by the PERLLIB and PERL5LIB environment variables, the -I<path> command-line option to perl, and the "use lib <path>;" perl instruction (which is the same as "BEGIN { unshift @INC, <path>; }")

Dynamicly changing the include path is on the wish-list, but isn't yet implemented.

You can change @INC by modifying /usr/bin/perl with a hex-editor, but that'll only work if you do not want to make the paths longer or add new ones.

Source: http://www.perlmonks.org/?node_id=9883
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl script help required to create users and changing the owner to pericular folder sridhar11 Programming 2 10-25-2005 02:16 PM
my perl installation is hosed abu_abdullaah Mandriva 1 07-24-2004 12:09 PM
Perl installation asks me for CD 4 dodo1983 Linux - Software 1 06-06-2004 05:06 AM
perl -MCPAN -e shell, resetting or changing mirror urls msteudel Linux - Software 3 04-23-2004 09:50 AM
Perl : Changing a single char in a string richhill Programming 2 09-17-2003 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration