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