File: Exporter6.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 (23 lines) | stat: -rw-r--r-- 444 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
# test the ability to map a hash of import names to target subroutines,
# used for exporting virtual methods into Template::Text, for example.
package My::Exporter6;
use base 'Badger::Exporter';

our $THING = 10;
our $METHODS = {
    foo => \&do_foo,
    bar => \&do_bar,
};

sub do_foo {
    return "Did foo";
}

sub do_bar {
    return "Did bar";
}

__PACKAGE__->export_tags( methods => $METHODS );
__PACKAGE__->export_any(qw( $THING ));

1;