Bash-History-Read
view release on metacpan or search on metacpan
lib/Bash/History/Read.pm view on Meta::CPAN
while (defined(my $line = <$fh>)) {
if ($line =~ /\A#(\d+)$/) {
$ts = $1;
} else {
$call_code->($ts, $line);
undef $ts;
}
}
}
sub each_hist(&) {
my $code = shift;
_doit('each_hist', $code);
}
sub parse_bash_history_file {
my ($path) = @_;
$path //= $ENV{HISTFILE} // "$ENV{HOME}/.bash_history";
open my($fh), "<", $path or die "Can't open bash history file '$path': $!";
( run in 0.750 second using v1.01-cache-2.11-cpan-65fba6d93b7 )