Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help With Win32::DriveInfo 1

Status
Not open for further replies.

gkey

MIS
Oct 24, 2000
1
US
I am a novice at perl and recently began learning about modules. I use perl on the WinNT 4 (and doing some experimentation on Win2000) platform.

I'm able to use modules that came with the ActiveState 5.6 package but am having problems using any modules I add. For instance, I got a copy of DriveInfo. The readme file simply instructs me as follows: "No special installation is needed. Just put it into /Win32 subdir somewhere in your @INC." The author also mentions that Win32::API.pm is needed to use this module. I got the api.pm file as well and installed in the same manner. When I try to run a simple script using Win32::DriveInfo:

use Win32::DriveInfo;
$type = Win32::DriveInfo::DriveType('a');
print "drive type is: $type\n";

I get the following error:

Can't locate loadable object for module Win32::API in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at E:/Perl/lib/Win32/DriveInfo.pm line 8
Compilation failed in require at E:/Perl/lib/Win32/DriveInfo.pm line 8.
BEGIN failed--compilation aborted at E:/Perl/lib/Win32/DriveInfo.pm line 8.
Compilation failed in require at E:\NotProf\test1.pl line 1.
BEGIN failed--compilation aborted at E:\NotProf\test1.pl line 1.

Any ideas where my mistake is? Can you point me at a good source on how to install and use modules? BTW, I also tried ppm but it tells me it cannot locate the .ppd file.

Thanks for your help in advance
 
I donwloaded the module and installed it.
It worked fine.
What version of perl are you using?

I put the pm file in \perl\site\lib\win32.
Code:
#!perl -w

use strict;

use Win32::DriveInfo;
my $type = Win32::DriveInfo::DriveType('a');
print "drive type is: $type\n";
output is

drive type is: 2

hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top