Term::ReadLine::Perl5::OO:History
Variables and functions supporting Term::ReadLine::Perl5's and Term::ReadLine::Perl5::OO's command history.
#add_line_to_history($line, $minlength)
Insert $line into history list if $line is:
bigger than the minimal length $minlength
not same as last entry
#add_history($line1, ...)
Place lines in array @_ at the end of the history list unless the history is stifled, or there are already too many items.
#read_history($filename)
Add the contents of $filename to the history list, a line at a time. If filename is undef, then read from `~/.history'. Returns 0 if successful, or $! if not.
#remove_history(unused, $which)
Remove history element $which from the history. The removed element is returned.
$which
GetHistory
returns the history of input as a list.
#SetHistory($line1 [, $line2, ...])
Sets the history of input, from where it can be used.
history_is_stifled
Returns true if saved history has a limited (stifled) or false if there is no limit (unstifled).
unstifle_history
Unstifle or remove limit the history list.
Theprevious maximum number of history entries is returned. The value is positive if the history was stifled and negative if it wasn't.
#replace_history_entry($which, $data)
Make the history entry at $which have $data. This returns the old entry. In the case of an invalid $which, undef is returned.
#clear_history()
Clear or reset readline history.
Write the current history to filename, overwriting filename if necessary. If filename is NULL, then write the history list to `~/.history'. Returns 0 on success, or errno on a read or write error.
read_history() and write_history() follow GNU Readline's C convention of returning 0 for success and 1 for failure.
#ReadHistory([$filename [,$from [,$to]]])
$i = ReadHistory('~/.history')
Adds the contents of $filename to the history list, a line at a time. If $<filename> is false, then read from ~/.history. Start reading at line $from and end at $to. If $from is omitted or zero, start at the beginning. If $to is omitted or less than $from, then read until the end of the file. Returns true if successful, or false if not.
Note: the return code is the negation of read_history. Otherwise, it's the same.
#WriteHistory([$filename])
$i = WriteHistory('~/.history')
Writes the current history to $filename, overwriting $filename if necessary. If $filename is false, then write the history list to ~/.history. Returns true if successful, or false if not. Note: the return code is the negation of write_history. Otherwise, it's the same.
Rocky Bernstein
Term::ReadLine::Perl5
To install Term::ReadLine::Perl5, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Term::ReadLine::Perl5
CPAN shell
perl -MCPAN -e shell install Term::ReadLine::Perl5
For more information on module installation, please visit the detailed CPAN module installation guide.