perlbrewã§ã¤ã³ã¹ãã¼ã«ããperlãã¡ã®@INCã¯$PERLBREW_ROOTé ä¸ã®ãã£ã¬ã¯ããªã«ãªãã¾ãããããã§äºãã«å½±é¿ããã«ã¢ã¸ã¥ã¼ã«ãå ¥ããããããã§ãããã·ã¹ãã å ¨ä½ã§å ±éã®ã¢ã¸ã¥ã¼ã«ãèªã¾ãããå±é¢ãããã¾ãã
PERL5LIB(ã§ãã¹ãæå®)ãPERL5OPT(ã§-Mlib=/path/to)ã§ãã§ãã¾ãããperl -MOrenoConf ã¨ããå ´åã¯ã¾ã ç°å¢å¤æ°ãè©ä¾¡ãããåãªã®ã§Can't locateã¨æããã¦ãã¾ãã¾ãã
Ubuntuã®system perl㯠/etc/perl ã @INC ã«å ¥ã£ã¦ãã¾ãã(確ãGentooã®ããããªæãã ã£ãã¨æãã¾ã)
$ perl -V ... @INC: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .
ä»ã¯ã¡ãã£ã¨éãããããã¾ãããã以å確èªããã¨ã㯠perl.c ã«ããããå½ã¦ã¦ã
incpush ("/etc/perl", FALSE, FALSE, FALSE);
ã¨ãã¦ãã¾ããã
ããã¨åãäºãperlbrewã§ãããããã¨æã£ãã®ã§ãããããããå½ã¦ãã®ã¯ããã©ããªããããã¨æãã¤ã¤perlbrewã®ãã«ã(perlbrew help install)ãçºãã¦ããã
--sitecustomize $filename Specify a file to be installed as sitecustomize.pl
ã¨ããã®ãã¿ã¤ãã¾ããã
é·å¹´Perlã触ã£ã¦ãã®ã«åãã¦è¦ãã®ã§ãããperldoc perlrunã«ããã°ã
Perl can be built so that it by default will try to execute
$Config{sitelib}/sitecustomize.pl at startup (in a BEGIN block).
This is a hook that allows the sysadmin to customize how perl
behaves. It can for instance be used to add entries to the @INC
array to make perl find modules in non-standard locations.
ã¨ã®ãã¨ã§ã$Config{sitelib}/sitecustomize.pl ã«ç½®ãããã¡ã¤ã«ãããã£ã±ãªã®æ¹ã®BEGINãããã¯ã§è©ä¾¡ãããããã«ã§ããããã ãperlæ¬ä½ã®ãã«ãæã«ãã®æå¹åã®æå®ãå¿ è¦ãã ããã§ãã
ãããæå¹ã«ãªã£ã¦ãããã©ããã¯ãperl -Vã®config_argsãè¦ãã°ç¢ºèªã§ãã¾ãã
$ perl -V | grep sitecustomize config_args='-de -Dprefix=... -Dusesitecustomize -Aeval:scriptdir=...
perlbrewã§sitecustomizeãæå¹ã«ãã¦ãã«ãããã«ã¯
perlbrew install --notest 5.16.1 --sitecustomize /usr/oreno/etc/perl/sitecustomize.pl
ã¨ãã¾ãã
ããã§ã/usr/oreno/etc/perl/sitecustomize.plã$Config{sitelib}/sitecustomize.plã«ãããã³ãã¼ãããperlèµ·åæã«è©ä¾¡ãããããã«ãªãã¾ãã
$Config{sitelib}ã®ãã¹ã¯
$ perl -MConfig -e 'warn $Config{sitelib}'
ã§ç¢ºèªã§ãã¾ãã
ã¨ããããã§ã$Config{sitelib}/sitecustomize.plã«
unshift @INC, "/usr/oreno/etc/perl"; 1;
ã¨æ¸ãã¦ããã°ã/usr/oreno/etc/perl/OrenoConf.pm ã«ããã¢ã¸ã¥ã¼ã«ããperl -e 'use OrenoConf;' ã perl -MOrenoConf ã§èªããããã«ãªãã¾ãï¼
ã¯ã£ã´ã¼ï¼ï¼