File: BeforeAfterOne.pm

package info (click to toggle)
libbadger-perl 0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,400 kB
  • sloc: perl: 11,004; makefile: 9
file content (40 lines) | stat: -rw-r--r-- 727 bytes parent folder | download
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
37
38
39
40
package My::Exporter::BeforeAfterOne;

our ($DONE_BEFORE, $DONE_AFTER);

use base 'My::Exporter::BeforeAfter';

__PACKAGE__->export_any('wibble wobble wubble');

__PACKAGE__->export_before(
    sub {
        my ($class, $target, $imports) = @_;
#       print "sub one before export [$class] [$target] [$imports]\n";
        pop @$imports;
        push(@$imports, 'wobble');
        $DONE_BEFORE = 1;
        return $imports;
    }
);

__PACKAGE__->export_after(
    sub {
        my ($class, $target) = @_;
        $DONE_AFTER = 1;
#       print "sub one after export [$class] [$target]\n";
    }
);

sub wibble {
    return 'wibblesome';
}

sub wobble {
    return 'wobblesome';
}

sub wubble {
    return 'wubblesome';
}

1;