git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4345
bd8105ee-0ff8-0310-8827-fb3f25b6796d
},
);
-around eval => sub {
- my $orig = shift;
+before eval => sub {
my $self = shift;
my $line = shift;
- my @ret = $orig->($self, $line, @_);
-
# prepend each line with #
$line =~ s/^/# /mg;
- my $step = $line . "\n"
- . join("\n", @ret)
- . "\n\n";
+ $self->add_to_session($line . "\n");
+};
+
+around eval => sub {
+ my $orig = shift;
+ my $self = shift;
+ my $line = shift;
+
+ my @ret = $orig->($self, $line, @_);
- $self->add_to_session($step);
+ $self->add_to_session(join("\n", @ret) . "\n\n");
return @ret;
};