use strict; use warnings 'all'; my $found; for my $in_path (@INC){ next if ! -e $in_path."\\Win32API\\File.pm"; print "found module in $in_path ...\n"; $found = 1; last; } if ($found){ require 'Win32API::File'; my @drv = map{s/\\$//;lc} Win32API::File::getLogicalDrives(); print @drv; } #### H:\>perl testINC.pl found module in C:/Perl/site/lib ... Can't locate Win32API::File in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at testINC.pl line 14.