File: TestModuleManifestSkip.pm

package info (click to toggle)
libmodule-manifest-skip-perl 0.23-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: perl: 125; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (4)
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
use strict; use warnings;
package TestModuleManifestSkip;

use base 'Exporter';

use Module::Manifest::Skip;
use Cwd qw[cwd abs_path];

our $HOME = cwd;
our $LIB = abs_path 'lib';
our $TEMPLATE = Module::Manifest::Skip->read_file('share/MANIFEST.SKIP');
our @EXPORT = qw[read_file copy_file cwd abs_path $HOME $LIB $TEMPLATE];

sub import {
    strict->import;
    warnings->import;
    goto &Exporter::import;
}

sub read_file {
    return Module::Manifest::Skip->read_file(@_);
}

sub copy_file {
    my ($src, $dest) = @_;
    open my $in, $src or die "Can't open $src for input";
    open my $out, '>', $dest or die "Can't open $dest for output";
    my $text = do { local $/; <$in> };
    print $out $text;
    close $out;
    close $in;
    return 1;
}

1;