Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Greetings monks
I'm in need of the Win32::Perms module on a Windows system with Activestate Perl installed on it. The module will be in a directory, and will not be installed on the system. Still, I need to get the owner/group/perms of files and directories in my script, and I don't think there's any other way than win32::perl (or is there?).
I tried putting the module in the same dir as the script and doing a "Use Perms". I tried setting %PERL5LIB% to the path of the location of the module (a %var% like this still looks icky. ugh.) but this didn't work either. I tried "use lib" with the correct path so its added to @INC but I get the errormessage saying it can't locate a loadable object to be used for this module. What to do? How can I still make use of this module?
Best regards
Quoth
Re: use win32::perms without installing it
by davidrw (Prior) on Sep 06, 2005 at 21:07 UTC
|
Why can't you install Win32::Perms naturally?
anyways, you were close in your manual attempts .. make your file structure look like this (but be aware this still might not work if there are other files that Win32/Perms.pm depends upon):
yourscript.pl
Win32/Perms.pm
And then in yourscript.pl do:
use lib qw/ c:\wherever\that\stuff\is /;
use Win32::Perms;
Look at perldoc -f use<c> and <c>perldoc -f require for more info how how tihngs are included.. | [reply] [Watch: Dir/Any] [d/l] [select] |
|
Tried your suggestion with and without setting PERL5LIB to the c:\mylibs dir which contains a win32/ dir with the perms.pm in it. This is what I get when trying to load the example script included with win32::perms:
Can't locate loadable object for module Win32::Perms in @INC (@INC contains: c:\
mylibs C:/Perl/lib C:/Perl/site/lib .) at showperm.pl line 18
Compilation failed in require at showperm.pl line 18.
BEGIN failed--compilation aborted at showperm.pl line 18.:
Apparantly there is something more to be done than just putting the files somewhere and adding the path to @INC:
| [reply] [Watch: Dir/Any] |
Re: use win32::perms without installing it
by CountZero (Bishop) on Sep 07, 2005 at 06:10 UTC
|
With this tool (Dependency Walker) you can check if the .dll files you need depend on other files you might not have.
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] [Watch: Dir/Any] |
Re: use win32::perms without installing it
by Anonymous Monk on Sep 06, 2005 at 21:20 UTC
|
the following errormessage is shown when trying to load my example script:
Can't load 'c:\stuph\perllib/Perms.dll' for module Win32::Perms: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 230.
Win32 can do POSIX dir. seps so that shouldn't be the issue. Apparantly it finds the module but has problems loading it?
-- Q
| [reply] [Watch: Dir/Any] |
|