| 1 |
#!/usr/bin/env perl |
| 2 |
# pmcheck -- check that Perl is set up correctly for Perl modules |
| 3 |
|
| 4 |
# ------ pragmas |
| 5 |
use strict; |
| 6 |
use warnings; |
| 7 |
|
| 8 |
our $VERSION = '2.0.0'; |
| 9 |
|
| 10 |
# ------ define variables |
| 11 |
my $dir = undef; # directory in @INC |
| 12 |
my $errors = 0; # count of errors found |
| 13 |
|
| 14 |
for $dir (@INC) { |
| 15 |
if (!-e $dir) { |
| 16 |
print "'$dir' is in \@INC but does not exist\n"; |
| 17 |
$errors++; |
| 18 |
next; |
| 19 |
} |
| 20 |
|
| 21 |
if (!-d $dir) { |
| 22 |
print "'$dir' is in \@INC but is not a directory\n"; |
| 23 |
$errors++; |
| 24 |
next; |
| 25 |
} |
| 26 |
|
| 27 |
if (!-r $dir) { |
| 28 |
print "'$dir' is in \@INC but you cannot read it\n"; |
| 29 |
$errors++; |
| 30 |
next; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
exit($errors != 0); |
| 35 |
|
| 36 |
__END__ |
| 37 |
|
| 38 |
=head1 NAME |
| 39 |
|
| 40 |
pmcheck - check that Perl is set up correctly for Perl modules |
| 41 |
|
| 42 |
=head1 DESCRIPTION |
| 43 |
|
| 44 |
pmcheck checks that Perl is correctly set up for Perl modules. |
| 45 |
For now, pmcheck just verifies that the entries in @INC |
| 46 |
are existing readable directories. |
| 47 |
|
| 48 |
=head1 SEE ALSO |
| 49 |
|
| 50 |
pmdirs(1), pmpath(1) |
| 51 |
|
| 52 |
=head1 AUTHOR and COPYRIGHTS |
| 53 |
|
| 54 |
Copyright (C) 2012-2014 Mark Leighton Fisher. |
| 55 |
|
| 56 |
=head1 LICENSE |
| 57 |
|
| 58 |
This is free software; you can redistribute it and/or modify it |
| 59 |
under the terms of either: |
| 60 |
(a) the GNU General Public License as published by the Free |
| 61 |
Software Foundation; either version 1, or (at your option) any |
| 62 |
later version, or |
| 63 |
(b) the Perl "Artistic License". |
| 64 |
(This is the Perl 5 licensing scheme.) |