Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
450 B

  1. #!/usr/bin/env perl
  2. # find a Perl module's path on the filesystem
  3. use warnings;
  4. use strict;
  5. use 5.10.0;
  6. my $to_use;
  7. if (defined $ARGV[0]) {
  8. $to_use = $ARGV[0];
  9. } else {
  10. die "Must specify a module to check path for.";
  11. }
  12. eval("use $to_use");
  13. my $filename = $to_use;
  14. $filename =~ s{ :: }{/}gx;
  15. $filename .= '.pm';
  16. if ($INC{$filename}) {
  17. say $INC{$filename};
  18. } else {
  19. say "$to_use not found";
  20. }
  21. # say $_ . " => " . $INC{$_} for keys %INC;