unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: those who know me have no need of my name <not-a-real-address@usa.net>
Subject: Re: Emacs like line editing during perl input.
Date: 30 Dec 2002 08:20:15 GMT	[thread overview]
Message-ID: <m1hecvx6u0.gnus@usa.net> (raw)
In-Reply-To: m28yy8gt8p.fsf@sbcglobal.net

[fu-t set]

in gnu.emacs.help i read:

>I'm sneaking in a perl question that is only slightly related to
>emacs.

it'd be a lot better answered in comp.lang.perl.misc or .modules.

>I'd like to have somekind of line editing available during user
>input to a perl script.
>
>By default it seems none is available.  Any attempt to navigate or
>edit an input line produces control chars.  Only backspace works to
>edit.

that's all that is provided by your system's terminal driver.  (probably
there are some other functions too, but nowhere near what emacs provides.)
most likely you want to special case terminal input to use Term::ReadLine.

>I think Term::ReadLine is the tool for this but couldn't figure out
>how to deploy it.

,----[ from ``perldoc Term::ReadLine'' ]
| NAME
|        Term::ReadLine - Perl interface to various "readline"
|        packages. If no real package is found, substitutes stubs
|        instead of basic functions.
| 
| SYNOPSIS
|          use Term::ReadLine;
|          $term = new Term::ReadLine 'Simple Perl calc';
|          $prompt = "Enter your arithmetic expression: ";
|          $OUT = $term->OUT || STDOUT;
|          while ( defined ($_ = $term->readline($prompt)) ) {
|            $res = eval($_), "\n";
|            warn $@ if $@;
|            print $OUT $res, "\n" unless $@;
|            $term->addhistory($_) if /\S/;
|          }
`----

-- 
bringing you boring signatures for 17 years

  reply	other threads:[~2002-12-30  8:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-30  2:01 Emacs like line editing during perl input Harry Putnam
2002-12-30  8:20 ` those who know me have no need of my name [this message]
2002-12-30 16:01   ` Harry Putnam
2002-12-30 16:15     ` those who know me have no need of my name
2002-12-31  1:17       ` Harry Putnam
2002-12-31  1:58         ` Bijan Soleymani
2002-12-31  2:32           ` Harry Putnam
2002-12-31  3:17           ` Harry Putnam
     [not found]           ` <mailman.737.1041305477.19936.help-gnu-emacs@gnu.org>
2002-12-31  3:52             ` Bijan Soleymani
2002-12-31  4:24               ` Harry Putnam
     [not found]               ` <mailman.738.1041308660.19936.help-gnu-emacs@gnu.org>
2002-12-31  5:45                 ` Bijan Soleymani
2002-12-31 15:14 ` Kai Großjohann
2002-12-31 15:30   ` Harry Putnam
2002-12-31 17:29     ` those who know me have no need of my name

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1hecvx6u0.gnus@usa.net \
    --to=not-a-real-address@usa.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).