/usr/share/perl5/Sepia/ReadLine.pm is in sepia 0.991.05-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | package Sepia::ReadLine;
use Term::ReadLine;
use Sepia;
require Exporter;
@ISA='Exporter';
@EXPORT='repl';
sub rl_attempted_complete
{
my ($text, $line, $start, $end) = @_;
my @xs;
if (substr($line, 0, $start) =~ /^\s*$/ && $text =~ /^,(\S*)$/) {
my $x = qr/^\Q$1\E/;
@xs = map ",$_", grep /$x/, keys %Sepia::REPL;
} else {
my ($type, $str) = (substr $line, $start && ($start-1), $end) =~ /^([\$\@\%\&]?)(.*)/;
my %h = qw(@ ARRAY % HASH & CODE * IO $ VARIABLE);
@xs = Sepia::completions $h{$type||'&'}, $str;
}
$TERM->completion_matches($text,
sub { $_[1] < @xs ? $xs[$_[1]] : () });
}
sub repl
{
{ package main; do $_ for @ARGV }
$TERM = new Term::ReadLine $0;
if (Term::ReadLine->ReadLine =~ /Gnu/) {
my $attr = $TERM->Attribs;
$attr->{attempted_completion_function} = \&rl_attempted_complete;
} else {
warn "Sepia::ReadLine: No completion without GNU Readline.\n";
}
$Sepia::READLINE = sub { $TERM->readline(Sepia::prompt()) };
goto &Sepia::repl;
}
1;
|