Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2016-02-06 22:04 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (236 votes), past polls