Skip to content

Instantly share code, notes, and snippets.

@omega
Created April 27, 2009 13:21
Show Gist options
  • Save omega/102480 to your computer and use it in GitHub Desktop.
Save omega/102480 to your computer and use it in GitHub Desktop.
PerlRequire etc/mod_perl_startup.pl
andreas@dev-andreas:~/local$ cat /home/andreas/.perllib
PATH=$PATH:~/local/bin:~/local/sbin
for i in `find /home/andreas/projects -maxdepth 3 -type d -not -regex '.*/x?t/?.*'`; do
if [ -d "$i/lib" ]; then
PERL5LIB=$i/lib:$PERL5LIB
fi
if [ -d "$i/script" ]; then
PATH=$i/script:$PATH
fi
if [ -d "$i/bin" ]; then
PATH=$i/bin:$PATH
fi
done
export PERL5LIB
export PATH
andreas@ds17:~/root/etc$ less mod_perl_startup.pl
use strict;
use lib qw(/home/andreas/projects/giza-ungarn/Apache/lib);
warn "in startup script";
use Data::Dump qw/dump/;
foreach my $dir (</home/andreas/projects/*/*/lib>) {
unshift @INC, $dir if -d $dir;
}
foreach my $dir (</home/andreas/projects/*/lib>) {
unshift @INC, $dir if -d $dir;
}
warn dump(@INC);
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment