Interactive program with command line history/vi mode--help needed 
Author Message
 Interactive program with command line history/vi mode--help needed

Hi,

I am a novice to perl. I apologize if this question sounds too
elementary.

I am working on a interactive perl program that takes input from
<STDIN>. It processes the command by invoking a set of perl
subroutines. The program looks somewhat like:

while ($line ne "end")
        {
        print "Program>";
        $line=<STDIN>;
        chomp $line;
        .....
        }

What I would like to do is give the program user the ability
to access previous commands (command line history) and editing
ability using the vi editor. I would like this to be similar
to what my ksh does (ESC-k for previous command, ESC-J for
next command and so on). Could somebody suggest a way to do
this in my program?

Thanks a lot in advance.

--Makesh



Mon, 03 Nov 2003 01:01:57 GMT  
 Interactive program with command line history/vi mode--help needed

Quote:
>I am a novice to perl. I apologize if this question sounds too
>elementary.

Sounds more like high school to me.
--

                                                   www.cars-suck.org


Mon, 03 Nov 2003 01:11:33 GMT  
 Interactive program with command line history/vi mode--help needed

Quote:

> I am a novice to perl. I apologize if this question sounds too
> elementary.

> I am working on a interactive perl program that takes input from
> <STDIN>. It processes the command by invoking a set of perl
> subroutines. The program looks somewhat like:

> while ($line ne "end")
>         {
>    print "Program>";
>         $line=<STDIN>;
>         chomp $line;
>         .....
>         }

> What I would like to do is give the program user the ability
> to access previous commands (command line history) and editing
> ability using the vi editor. I would like this to be similar
> to what my ksh does (ESC-k for previous command, ESC-J for
> next command and so on). Could somebody suggest a way to do
> this in my program?

Use the Term::ReadLine module.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Mon, 03 Nov 2003 01:13:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. s/// command in an interactive mode.

2. interactive command line in perl script

3. HELP: How to program command line args

4. Invoking (interactive) vi editor

5. Newbie needs help- trying to submit command-line function to perl script via web

6. Interactive line editing/ NEED something like CURSES/ READLINE////

7. Need help with command line for CGI for NT

8. Need help with command line arguments

9. Need help implementing command line switch

10. inputing parameters on command line *HELP* needed

11. system call works in command line mode but not from web

12. cperl-mode vs vi

 

 
Powered by phpBB® Forum Software