sub find_installed_path { my $module_name = shift; # For Unix systems: $module_name =~ s!::!/!g; # For Windows: #$module_name =~ s!::!\\!g; $module_name .= '.pm'; foreach my $path (@INC) { next if (ref $path); return "$path/$module_name" if (-f "$path/$module_name"); } return ''; } print find_installed_path('File::Find');