how to solve when no root privilege? 
Author Message
 how to solve when no root privilege?

I'm using a perl that needs to access a module but since the perl is
accessed from different paths so the module is "invisible". Since I don't
have root privilege to place the module to the library path, what can I do
to solve the problem? Either duplicating the perl and module or moving all
the data files to the perl program path is a bad idea... though it does
solve the problem...


Thu, 14 Mar 2013 05:19:27 GMT  
 how to solve when no root privilege?

Quote:

> I'm using a perl that needs to access a module but since the perl is
> accessed from different paths so the module is "invisible".

"Invisible" in what way? Is your script running in a chroot jail in which
the path is literally invisible? Is it running as a user that does not
have permission to read the path? Or is it simply that the path to the

The last issue is easy, and something you can do in your own scripts -
have a look at 'perldoc lib'.

For the first two, you need to either convince your admin to make the
module path visible (by configuring the jail and/or permissions), or
install the module to a path that is already visible.

sherm--

--
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer



Wed, 13 Mar 2013 15:23:41 GMT  
 how to solve when no root privilege?

Quote:
> The last issue is easy, and something you can do in your own scripts -
> have a look at 'perldoc lib'.

Or even if one cannot edit the script, on the command line:

perl -Idir foo

Assuming the module is found in directory 'dir', and the script is
'foo'.
I kind of understand that 'foo' has a shebang pointing to a perl,
which

Guessing to compensate for lack of information.

Marc



Wed, 13 Mar 2013 21:35:30 GMT  
 how to solve when no root privilege?

Quote:

> I'm using a perl that needs to access a module but since the perl is
> accessed from different paths so the module is "invisible".

The path to perl does not change what directories modules
can be found in for that perl.

Are you getting an error message of some sort?

If so, then what does the error message say?

Have you seen the Posting Guidelines that are posted here frequently?

Quote:
> Since I don't
> have root privilege to place the module to the library path,

You do not need root privilege to add your module's path to
the list of paths that will be searched for modules.

Quote:
> what can I do
> to solve the problem?

Add your module's path to the list of paths that will be searched for
modules. You can do this with a "use lib" directive (perldoc lib),
or by setting the PERL5LIB environment variable, or by using
the "-I" command line switch (perldoc perlrun) when you invoke perl.

Quote:
> Either duplicating the perl and module or moving all
> the data files to the perl program path is a bad idea... though it does
> solve the problem...

data files do not go in module directories.

*program* files go in module directories.

--
Rest In Peace:
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.



Thu, 14 Mar 2013 03:01:49 GMT  
 how to solve when no root privilege?


Quote:

> Are you getting an error message of some sort?

> If so, then what does the error message say?

> Add your module's path to the list of paths that will be searched for
> modules. You can do this with a "use lib" directive (perldoc lib),
> or by setting the PERL5LIB environment variable, or by using
> the "-I" command line switch (perldoc perlrun) when you invoke perl.

Thanks Tad McClellan and Marc Girod, in fact after writing something like:

use lib '/myperl/ImportedModule';

the path error goes away. Unfortunately, another error comes out for the
line:

$db = ImportedModule->new( dict => $dictfile);

as:

Unquoted string "ImportedModule" may clash with future reserved word at
/myperl/test.pl line 26.
Can't locate object method "new" via package "ImportedModule" (perhaps you
forgot to load "ImportedModule"?) at /myperl/test.pl line 26.

In fact, in perl, is there any systematic way to troubleshoot? Google
"Unquoted string may clash with future reserved word at" or "Can't locate
object method " just return many irrelevant results. To start with perldoc,
I just don't know what specific topics should go with....



Thu, 14 Mar 2013 18:13:52 GMT  
 how to solve when no root privilege?

Quote:

>Unquoted string "ImportedModule" may clash with future reserved word at
>/myperl/test.pl line 26.

>In fact, in perl, is there any systematic way to troubleshoot? Google
>"Unquoted string may clash with future reserved word at" or "Can't locate
>object method " just return many irrelevant results. To start with perldoc,
>I just don't know what specific topics should go with....

perldoc perldiag

jue



Thu, 14 Mar 2013 03:21:26 GMT  
 how to solve when no root privilege?


Quote:

> Unquoted string "ImportedModule" may clash with future reserved word at
> /myperl/test.pl line 26.

If you got that warning you're not using 'strict'. Please stop wasting
everybody's time.

(I also can't see any possible way you could get that warning for a word
that isn't entirely lowercase, but maybe I'm missing something...)

Ben



Thu, 14 Mar 2013 03:57:46 GMT  
 how to solve when no root privilege?


Quote:
> perldoc perldiag

> jue

Thanks for your reference. After examination, I find out the problem comes
from that the library cannot be identified.

although http://perldoc.perl.org/lib.html tells what "use lib" does, it does
not give any examples and so I just don't know whether the directive is done
successfully. So is the following correct?

the module "a.pm" is placed at /pathA/dirA
=========
so in b.pl, I write:

use lib '/pathA/dirA';

a->new (something...);
=========
in a.pm,

package a;
=========
so is the whole thing correct?



Thu, 14 Mar 2013 19:11:36 GMT  
 how to solve when no root privilege?

Quote:



>> perldoc perldiag

>> jue

> Thanks for your reference. After examination, I find out the problem comes
> from that the library cannot be identified.

> although http://perldoc.perl.org/lib.html tells what "use lib" does, it does
> not give any examples and so I just don't know whether the directive is done
> successfully. So is the following correct?

> the module "a.pm" is placed at /pathA/dirA
> =========
> so in b.pl, I write:

> use lib '/pathA/dirA';

> a->new (something...);
> =========
> in a.pm,

> package a;
> =========
> so is the whole thing correct?


of directories in which a module is searched for. You still need to
'use' your module - i.e. 'use a'.

sherm--

--
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer



Thu, 14 Mar 2013 04:28:58 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Scripts with root privileges

2. correctly dropping privileges

3. ora_login with SYSDBA privileges

4. administrator insufficient privileges

5. How to install a module without AD privilege??

6. write privilege for script.

7. Wrapper for constructing a privileged socket

8. NTPerl and privileges

9. dereference and xs question(perl5.000) (Solved)

10. help me to solve this question. , ,

11. Solved: -- Re: capturing STDOUT in a variable

12. Stupid Problem, yet, I can't solve it - HELP - regexp

 

 
Powered by phpBB® Forum Software