PERL   23

check mail modules pl

Guest on 10th July 2022 07:53:20 PM

  1. #!/usr/bin/perl
  2.  
  3. # new_file.pl - SHORT DESC
  4. # dprelec,
  5.  
  6. use strict;
  7. use warnings;
  8. use utf8;
  9.  
  10. my @modules = qw(
  11. Email::Sender::Simple
  12. Email::Simple
  13. Email::Simple::Creator
  14. );
  15.  
  16. print "Content-type: text/plain\n\n";
  17.  
  18. print "Perl: $^V\n";
  19. print "INC:\n";
  20. print "@INC";
  21. print "\n";
  22. for my $key (sort keys %INC) {
  23.     print "$INC{$key}\n";
  24. }
  25. print "\n";
  26.  
  27. for my $module (@modules) {
  28.     print "require $module ";
  29.     eval "use $module;";
  30.     if ($@) {
  31.         print "ERROR $@\n";
  32.     }
  33.     else {
  34.         print "OK\n";
  35.     }
  36. }
  37.  
  38. print "\n\n";
  39. print system("ls -R /usr/share/perl5");

Raw Paste


Login or Register to edit or fork this paste. It's free.