use File::Spec; my $mod_path; foreach my $i (@INC) { if ( -f File::Spec->catfile($i, 'Some/Module.pm') ) { $mod_path = $i; last; } } if ($mod_path) { # Some::Module is installed here. } else { # Some::Module is not installed anywhere. }