Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need Help With Win32::DriveInfo

Need Help With Win32::DriveInfo

Need Help With Win32::DriveInfo

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

RE: Need Help With Win32::DriveInfo

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.

#!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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close