NAME

Term::ReadLine::Perl5::History

DESCRIPTION

Variables and functions supporting Term::ReadLine::Perl5's command history. This pretends to be OO code even though it doesn't make use of the object's state. Instead it relies on a global history mechanism.

The underlying non-OO routines are elsewhere.

SUBROUTINES

add_line_to_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

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.

clear_history

clear_history()

Clear or reset readline history.

replace_history_entry

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.

unstifle_history

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.

history_is_stifled

history_is_stifled

Returns true if saved history has a limited (stifled) or false if there is no limit (unstifled).

remove_history

remove_history($which, $history_length)

Remove history element $which from the history. The removed element is returned.

ReadHistory

ReadHistory([$filename [,$from [,$to]]])

$i = read_history('~/.history')
$i = read_history_range('~/.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.

read_history() is an alias of read_history_range().

WriteHistory

WriteHistory([$filename])

$i = write_history('~/.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.

SetHistory

SetHistory($line1 [, $line2, ...])

Sets the history of input, from where it can be used.

GetHistory

GetHistory

returns the history of input as a list.

AUTHOR

Rocky Bernstein

SEE ALSO

Term::ReadLine::Perl5