use strict; use warnings; use Module::ScanDeps; # insert your script(s) name(s) here my @scripts = qw/ myscript.pl /; my $hash_ref = scan_deps( files => \@scripts, recurse => 1, ); print $$hash_ref{$_}->{'key'}."\n" for sort keys %$hash_ref;