[Bast-commits] r3767 - trunk/Devel-REPL/lib/Devel/REPL

Sartak at dev.catalyst.perl.org Sartak at dev.catalyst.perl.org
Fri Sep 21 06:44:02 GMT 2007


Author: Sartak
Date: 2007-09-21 06:44:01 +0100 (Fri, 21 Sep 2007)
New Revision: 3767

Modified:
   trunk/Devel-REPL/lib/Devel/REPL/Script.pm
Log:
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? :)


Modified: trunk/Devel-REPL/lib/Devel/REPL/Script.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Script.pm	2007-09-21 05:35:25 UTC (rev 3766)
+++ trunk/Devel-REPL/lib/Devel/REPL/Script.pm	2007-09-21 05:44:01 UTC (rev 3767)
@@ -17,6 +17,10 @@
   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 @@
   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_scripts {
+  my ($self, $scripts) = @_;
+
+  for (@$scripts) {
+    do $_;
+  }
+}
+
 sub eval_rcdata {
   my ($self, $data) = @_;
   local $CURRENT_SCRIPT = $self;




More information about the Bast-commits mailing list