This question has been asked before. To recap: this is a VERY difficult job to do in Perl, as there are so very many ways to introduce some type of external dependency. You may be able to knock out the most obvious dependencies by looking for use/require/do statements, but anything more complex will not have a regular structure, and thus will be harder to find programmatically.