2007/9/17, perllearner <[EMAIL PROTECTED]>:
> I am having a look at cpanel v3 code for using a perl module after
> installing it in your user directory (when not root):
>
> my $homedir = (getpwuid($>))[7];my $n_inc = scalar @INC;for (my $i =
> 0; $i < $n_inc; $i++ ) { if (-d $homedir . '/perl' . $INC[$i])
> { unshift(@INC,$homedir . '/perl' . $INC[$i]); $n_inc+
> +; $i++; }}
>
> However this doesn't work
Hi,
I just tested the codes above,they can work fine,thought they're
written with bad style.
Add these lines into your script:
BEGIN {
my $homedir = (getpwuid($>))[7];
my $n_inc = scalar @INC;
for (my $i =0; $i < $n_inc; $i++ ) {
if (-d $homedir . '/perl' . $INC[$i]) {
unshift(@INC,$homedir . '/perl' . $INC[$i]);
$n_inc++;
$i++;
}
}
}
And be sure you have created your own module dirs.
>From what the codes doing,your own module dirs should properly be located in:
$homedir/perl/perl_module_system_dirs
you can,
use Data::Dumper;
print Dumper [EMAIL PROTECTED];
to see what's perl_module_system_dirs on your OS.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/