File: BuildTools.pm

package info (click to toggle)
libnumber-phone-perl 4.0006-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 41,696 kB
  • sloc: perl: 1,933; makefile: 6
file content (36 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package # hah, fooled you PAUSE
    Number::Phone::BuildTools;

use strict;
use warnings;

use Exporter qw(import);
our @ISA = qw(Exporter);
our @EXPORT = qw(PM_from_manifest files_from_manifest modules_from_manifest);
our $without_uk = 0;

sub PM_from_manifest {
    open(my $manifest, 'MANIFEST') || die("Couldn't open MANIFEST\n");
    return {
        map { $_ => "blib/$_" }
        grep {
            /^lib.*\.pm$/ && (
                !$without_uk ||
                $_ !~ /UK/
            )
        }
        map { chomp; $_ } <$manifest>
    };
}

sub files_from_manifest { return sort keys %{PM_from_manifest()}; }

sub modules_from_manifest {
    return map {
        s/(^lib\/|\.pm$)//g;
        s/\//::/g;
        $_
    } files_from_manifest();
}

1;