Bash-History-Read

 view release on metacpan or  search on metacpan

lib/Bash/History/Read.pm  view on Meta::CPAN

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    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.236 second using v1.01-cache-2.11-cpan-cba739cd03b )