```{index} single: rl_readline; Term::ReadLine::Gnu function ``` ```{index} single: Term::ReadLine::Gnu::rl_readline; Perl function ``` # rl_readline Display a prompt, read one line with full editing, and return the entered string (or `undef` on EOF). ## Synopsis ```perl while (defined (my $line = $term->readline('prompt> '))) { $term->addhistory($line) if $line =~ /\S/; last if $line eq 'quit'; } ``` The call blocks until the user presses Return. A bare Ctrl-D on an empty line returns `undef`. The returned string has its trailing newline already stripped, matching the underlying `readline(3)` C function. The prompt argument is optional; pass `undef` for none.