File: BeforeAfterTwo.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-- 786 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::BeforeAfterTwo;

our ($DONE_BEFORE, $DONE_AFTER);

use Badger::Class
    base    => 'My::Exporter::BeforeAfter',
    exports => {
        before => \&before_export,
        after  => \&after_export,
        any    => 'wibble wobble wubble',
    };

sub before_export {
    my ($class, $target, $imports) = @_;
#   print "sub two before export [$class] [$target] [$imports]\n";
    pop(@$imports);                 # remove 99
    push(@$imports, 'wobble');      # push wobble
    $DONE_BEFORE = 1;
    return $imports;
}

sub after_export {
    my ($class, $target) = @_;
    $DONE_AFTER = 1;
#   print "sub two after export [$class] [$target]\n";
}

sub wibble {
    return 'wibbly';
}

sub wobble {
    return 'wobbly';
}

sub wubble {
    return 'wubbly';
}

1;