at2marty has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a script that presents a menu and asks the user to select a choice. I don't quite understand why it is not working like I think it should.
What I get is a blank screen, and if I make a choice, the script briefly prints the menu then continues on.
Here is a snippet of my script (it is quite long).
#!/usr/bin/perl -w use strict; my $question; my $computer; my @pc = qw(comp1 comp2 comp3 comp4 comp5); # Find out which computer to cold start system("clear"); do { print "Which computer would you like to cold start?\n"; print "1 - comp1 2 - comp2 3 - comp3 4 - comp4 5 - comp5\n"; $question = <STDIN>; chomp($question); } until ($question >= 1) & ($question <= 5); $question--; $computer = $pc[$question];
Any advice is certainly appreciated. Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Trouble Creating a Menu
by zentara (Cardinal) on Aug 12, 2012 at 17:04 UTC | |
Re: Trouble Creating a Menu
by xyzzy (Pilgrim) on Aug 12, 2012 at 17:10 UTC | |
by at2marty (Novice) on Aug 12, 2012 at 21:40 UTC | |
Re: Trouble Creating a Menu
by Anonymous Monk on Aug 12, 2012 at 16:53 UTC | |
Re: Trouble Creating a Menu
by BillKSmith (Monsignor) on Aug 12, 2012 at 17:03 UTC | |
Re: Trouble Creating a Menu
by aaron_baugher (Curate) on Aug 12, 2012 at 21:20 UTC | |
Re: Trouble Creating a Menu
by Marshall (Canon) on Aug 13, 2012 at 13:29 UTC |