Update SYNOPSIS to match tinyrepl
David Leadbeater [Sat, 29 Jan 2011 14:31:24 +0000 (14:31 +0000)]
bin/tinyrepl
lib/Eval/WithLexicals.pm

index 4b78618..f9087ea 100755 (executable)
@@ -4,7 +4,6 @@ use strictures 1;
 use Eval::WithLexicals;
 use Term::ReadLine;
 use Data::Dumper;
-
 use Getopt::Long;
 
 GetOptions(
index e462063..752de55 100644 (file)
@@ -151,6 +151,11 @@ Eval::WithLexicals - pure perl eval with persistent lexical variables
   use Eval::WithLexicals;
   use Term::ReadLine;
   use Data::Dumper;
+  use Getopt::Long;
+
+  GetOptions(
+    "plugin=s" => \my @plugins
+  );
 
   $SIG{INT} = sub { warn "SIGINT\n" };
 
@@ -159,7 +164,10 @@ Eval::WithLexicals - pure perl eval with persistent lexical variables
     $Quotekeys = 0;
   }
 
-  my $eval = Eval::WithLexicals->new;
+  my $eval = @plugins
+   ? Eval::WithLexicals->with_plugins(@plugins)->new
+   : Eval::WithLexicals->new;
+
   my $read = Term::ReadLine->new('Perl REPL');
   while (1) {
     my $line = $read->readline('re.pl$ ');