|
Revision 32282, 0.6 kB
(checked in by ktat, 4 years ago)
|
|
support Sub::Exporter
support some of exporting ways from Sub::Exporter.
refactor code.
|
| Line | |
|---|
| 1 | package UtilExporter; |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use Clone qw/clone/; |
|---|
| 5 | |
|---|
| 6 | use Util::Any -Exporter; |
|---|
| 7 | |
|---|
| 8 | our @EXPORT = qw/hello/; |
|---|
| 9 | our @EXPORT_OK = qw/askme hello hi/; |
|---|
| 10 | our %EXPORT_TAGS = ( |
|---|
| 11 | 'greet' => [qw/hello hi/], |
|---|
| 12 | 'uk' => [qw/hello/], |
|---|
| 13 | 'us' => [qw/hi/], |
|---|
| 14 | 'hello' => [qw/hello_name hello_where/], |
|---|
| 15 | ); |
|---|
| 16 | |
|---|
| 17 | our $Utils = clone $Util::Any::Utils; |
|---|
| 18 | $Utils->{l2s} = [ |
|---|
| 19 | ['List::Util', '', [qw(first min minstr max maxstr sum)]], |
|---|
| 20 | ]; |
|---|
| 21 | $Utils->{-hello} = ['exampleHello']; |
|---|
| 22 | |
|---|
| 23 | sub hello { "hello there" } |
|---|
| 24 | sub askme { "what you will" } |
|---|
| 25 | sub hi { "hi there" } |
|---|
| 26 | |
|---|
| 27 | 1; |
|---|