Added Plugin/NewlineHack, simple plugin to print a newline after output
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / NewlineHack.pm
diff --git a/lib/Devel/REPL/Plugin/NewlineHack.pm b/lib/Devel/REPL/Plugin/NewlineHack.pm
new file mode 100644 (file)
index 0000000..96a464f
--- /dev/null
@@ -0,0 +1,19 @@
+# Adds a newline after print. Some readlines need it some don't. I guess
+# we should clarify whether this is a bug and if so whose bug at some point
+# but this'll do for now ;)
+
+package Devel::REPL::Plugin::NewlineHack;
+
+use Moose::Role;
+
+use Data::Dumper;
+
+after 'print' => sub {
+  # not fussed about args
+  my ($self) = @_;
+  my $fh = $self->out_fh;
+  print $fh "\n";
+};
+
+1;
+