From: Sartak Date: Fri, 21 Sep 2007 05:44:01 +0000 (+0000) Subject: You can now use re.pl -e 1.pl -e 2.pl to run 1.pl 2.pl then get the REPL. Do we actua... X-Git-Tag: v1.003015~148 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=commitdiff_plain;h=fa626608ee63e378ad7f476b24f732b7aa6c9745 You can now use re.pl -e 1.pl -e 2.pl to run 1.pl 2.pl then get the REPL. Do we actually even want this feature? :) git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@3767 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- 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;