Looking through the source code of Devel::REPL::Plugin::History, it seems that Devel::REPL::Plugin::ReadLineHistory::WithoutExpansion simply fiddles the wrong bits (well, the ReadLine expansion of the underlying Term::ReadLine object). The source code in Devel::REPL::Plugin::History ignores all that and does the ! expansion in a hardcoded way:
# Devel::REPL::Plugin::History
around 'read' => sub {
my $orig = shift;
my ($self, @args) = @_;
my $line = $self->$orig(@args);
if (defined $line) {
if ($line =~ m/^!(.*)$/) {
my $call = $1;
$line = $self->history_call($call);
if (defined $line) {
$self->print($line."\n");
} else {
return "'Unable to find ${call} in history'";
}
}
if ($line =~ m/\S/) {
$self->push_history($line);
}
}
return $line;
};
Looking at the code more, prefixing !!1 by whitespace should work around the issue in the way you want...
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|