Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: General pattern for interactive text-mode script?

by apl (Monsignor)
on Jul 03, 2008 at 23:19 UTC ( #695494=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        'Major task to perform?' => ['task_1','task_2','task_2'],
    
  2. or download this
        'Major task to perform?' =>
           {
             answers => [ 'Add',   'Delete', 'Rename' ],
             keys    => [ 'task_1','task_2', 'task_2' ],
           },
    
  3. or download this
    my $current_key = 'Major task to perform?';
    while ( my $choice = prompt( $current_key, ...)) {
    ...
        # else $current_key = $structure{$current_key}{keys}[INDEX]
    }
    <p>A lot of the code is left as an exercise to the reader. Good luck w
    +ith your class.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://695494]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-09-22 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (186 votes), past polls