Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl Hotkey/Shortcut

by RedElk (Hermit)
on Aug 26, 2011 at 16:13 UTC ( #922697=note: print w/ replies, xml ) Need Help??


in reply to Perl Hotkey/Shortcut

Don't know if this will fit your needs but you might consider an until statement like the following:

use strict; use warnings; $_ = ""; until (/^q/i) { print "What to do: ('o' for options)\n"; chomp ($_ = <STDIN>); if ($_ eq "o") { dboptions() } elsif {$_ eq "r" { readdb() } elsif ..... ..... else {print "Sorry, try again.\n";} } sub dboptions { print <<EOF; Your options are: o - view options r - read .... .... EOF }

Gleaned from Chapter 13, Beginning Perl, page 441.


Comment on Re: Perl Hotkey/Shortcut
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2015-07-05 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls