detect-module.pl 301 B

123456789
  1. #!/usr/bin/env perl
  2. # License: CC0
  3. # Detects if a Perl module is installed on system and prints a message if not.
  4. # More ways here: https://www.perlmonks.org/?node_id=807408
  5. use Module::Load::Conditional qw(can_load);
  6. can_load( modules => {'Example::Module::Name'} ) or die('module not installed');