summaryrefslogtreecommitdiffstats
path: root/bin/repl
blob: 9b41333ca22709ca4478cd3210b61f226cd40c1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env perl
use strict;
use warnings;
# PODNAME: repl

use App::REPL;

my $cfg = "$ENV{HOME}/.replrc";

my %args = (script => $cfg);
if (!-e $cfg) {
    print("$cfg not found. Generating a default...\n");
    if (open my $fh, '>', $cfg) {
        print $fh <DATA>;
        close $fh;
    }
    else {
        warn "Couldn't write to $cfg";
        %args = ();
    }
}

App::REPL->new(%args)->run;

__DATA__
load_plugin
    'Interrupt',

    'FancyPrompt',
    'DataDumper',

    'Colors',
    'ReadLine',
    'Hints',
    'Packages',
    'LexicalPersistence',
    ;

postlude <<POSTLUDE;
use strict;
use warnings;
POSTLUDE