X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FScript.pm;fp=lib%2FDevel%2FREPL%2FScript.pm;h=6da9202cdb892b9c6074f86d5cb2c366d7858213;hp=bf36136466ef8f2e09a210fbe7218fbf03b8a962;hb=fa626608ee63e378ad7f476b24f732b7aa6c9745;hpb=33628ecb3689f2719563d0a9ae82d3ccec1a4cbb diff --git a/lib/Devel/REPL/Script.pm b/lib/Devel/REPL/Script.pm index bf36136..6da9202 100644 --- a/lib/Devel/REPL/Script.pm +++ b/lib/Devel/REPL/Script.pm @@ -17,6 +17,10 @@ has 'profile' => ( is => 'ro', isa => 'Str', required => 1, default => sub { 'Default' }, ); +has 'e' => ( + is => 'ro', isa => 'ArrayRef', default => sub { [] }, +); + has '_repl' => ( is => 'ro', isa => 'Devel::REPL', required => 1, default => sub { Devel::REPL->new() } @@ -26,6 +30,7 @@ sub BUILD { my ($self) = @_; $self->load_profile($self->profile); $self->load_rcfile($self->rcfile); + $self->load_scripts($self->e); } sub load_profile { @@ -55,6 +60,14 @@ sub load_rcfile { } } +sub load_scripts { + my ($self, $scripts) = @_; + + for (@$scripts) { + do $_; + } +} + sub eval_rcdata { my ($self, $data) = @_; local $CURRENT_SCRIPT = $self;