From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: those who know me have no need of my name Newsgroups: gmane.emacs.help Subject: Re: Emacs like line editing during perl input. Date: 30 Dec 2002 08:20:15 GMT Organization: earthfriends 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 1041236508 10212 80.91.224.249 (30 Dec 2002 08:21:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2002 08:21:48 +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 18SvBC-0002eZ-00 for ; Mon, 30 Dec 2002 09:21:46 +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 18SvAJ-0004kM-06 for gnu-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2002 03:20:51 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!DIRECTV!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.perl.modules Original-Followup-To: comp.lang.perl.modules User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Military Intelligence, i686-redhat-linux) Original-X-Complaints-To: abuse@supernews.com Original-Lines: 44 Original-Xref: shelby.stanford.edu gnu.emacs.help:108595 comp.lang.perl.modules:57715 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:5124 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5124 [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