1 package ReplyStartup; |
1 package ReplyStartup; |
2 use warnings; |
2 use warnings; |
3 use strict; |
3 use strict; |
4 use parent 'Import::Base'; |
|
5 |
4 |
6 our @IMPORT_MODULES = ( |
5 use Import::Into; |
7 'strict', |
|
8 'warnings', |
|
9 'feature' => [':5.14'], |
|
10 'experimentals', |
|
11 'Path::Tiny', |
|
12 ); |
|
13 |
6 |
14 sub import { |
7 sub import { |
15 my $caller = caller(0); |
8 my $caller = caller(0); |
16 |
9 |
17 # Run anything in .replyrc.local.pl in the context of main, at compile time. |
10 import::into(feature => $caller, ':5.14'); |
|
11 import::into($_ => $caller) for qw( |
|
12 strict |
|
13 warnings |
|
14 experimentals |
|
15 Path::Tiny |
|
16 ); |
|
17 |
|
18 # Run anything in .replyrc.local.pl in the context of |
|
19 # main, at compile time. |
18 eval(<<END_PERL)->(); |
20 eval(<<END_PERL)->(); |
19 package $caller; sub { |
21 package $caller; sub { |
20 -e \$_ && do(\$_) for glob('~/.replyrc.local.pl'); |
22 -e \$_ && do(\$_) for glob('~/.replyrc.local.pl'); |
21 die \$@ if \$@; |
23 die \$@ if \$@; |
22 } |
24 } |
23 END_PERL |
25 END_PERL |
24 |
|
25 our @ISA; |
|
26 goto($ISA[0]->can('import')); |
|
27 } |
26 } |
28 |
27 |
29 1; |
28 1; |