From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: Emacs like line editing during perl input. Date: Mon, 30 Dec 2002 16:01:23 GMT Organization: Still searching... Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041264345 18343 80.91.224.249 (30 Dec 2002 16:05:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2002 16:05:45 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18T2Q7-0004l2-00 for ; Mon, 30 Dec 2002 17:05:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18T2Q9-0004Kz-09 for gnu-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2002 11:05:41 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.wirehub.nl!news.astraweb.com!news-small.astraweb.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.com.POSTED!cbca52ab!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Original-Lines: 47 Cancel-Lock: sha1:HfaPI8ApR6i8kezpNF9ag2IkSLU= Original-NNTP-Posting-Host: 63.207.140.71 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr13.news.prodigy.com 1041264083 ST000 63.207.140.71 (Mon, 30 Dec 2002 11:01:23 EST) Original-NNTP-Posting-Date: Mon, 30 Dec 2002 11:01:23 EST X-UserInfo1: SCSYQN_@FS@CRUH[N[O@_WH@YR_B@EXLLBWLOOAFQATJUZ]CDVW[AKK[J\]^HVKHG^EWZHBLO^[\NH_AZFWGN^\DHNVMX_DHHX[FSQKBOTS@@BP^]C@RHS_AGDDC[AJM_T[GZNRNZAY]GNCPBDYKOLK^_CZFWPGHZIXW@C[AFKBBQS@E@DAZ]VDFUNTQQ]FN Original-Xref: shelby.stanford.edu gnu.emacs.help:108600 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5129 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5129 those who know me have no need of my name writes: Sorry Those, but Nope ... you're not redirecting me. I posted here for a purpose. I wanted the input of emacs perl sharpies. >>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. Not sure why you would post the synopsis since I had stated clearly it was not parsable by me. I wasn't able to see how to translate that example into something usable to make user input editable. > | 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/; > | } > `---- For example: In the above script, the input lines are no more editable than with perl -e 'while (<>){print}' $ ksh93 $ set -o emacs $ read