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; }