move reply startup

Thu, 15 Feb 2018 15:29:28 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 15 Feb 2018 15:29:28 -0500
changeset 683
ea343e7d3abc
parent 682
31d13f6d3a30
child 684
217647e6c878

move reply startup

.lib/perl5/ReplyStartup.pm file | annotate | diff | comparison | revisions
.replyrc file | annotate | diff | comparison | revisions
new file mode 100644
--- /dev/null
+++ b/.lib/perl5/ReplyStartup.pm
@@ -0,0 +1,22 @@
+package ReplyStartup;
+
+sub import {
+  my $code = eval(<<END_PERL) or die $@;
+    package main;
+    sub {
+      warnings->import;
+      strict->import;
+      require feature; feature->import(':5.14');
+      require experimentals; experimentals->import;
+
+      use Path::Tiny;
+
+      -e \$_ && do(\$_) for "\$ENV{HOME}/.replyrc.local.pl";
+      die \$@ if \$@;
+    }
+END_PERL
+
+  $code->();
+}
+
+1;
--- a/.replyrc
+++ b/.replyrc
@@ -1,5 +1,4 @@
-script_line1 = use strict; use warnings; use 5.014; use experimentals; use Path::Tiny;
-script_line2 = require('~/.replyrc.local.pl') if -e '~/.replyrc.local.pl'; ();
+script_line1 = use lib "$ENV{HOME}/.lib/perl5"; use ReplyStartup;
 
 [Colors]
 [DataPrinter]

mercurial