<?xml version="1.0" encoding="windows-1252"?>
<node id="986971" title="Re: Trouble Creating a Menu" created="2012-08-12 13:04:16" updated="2012-08-12 13:04:16">
<type id="11">
note</type>
<author id="131741">
zentara</author>
<data>
<field name="doctext">
Your script works for me. Maybe the addition of a bit of code will help you see what is happening at the end of the script. You need to remember that STDIN is line buffered, so if you select 2 for example, you still need to hit a Return for it to be read by $question = &lt;STDIN&gt;;&lt;p&gt;If you want single key responses, see [id://986955] , where you don't need the Return key to capture a keystroke.
&lt;c&gt;
#!/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 = &lt;STDIN&gt;;

    chomp($question);

} until ($question &gt;= 1) &amp; ($question &lt;= 5);

$question--;

$computer = $pc[$question];

print "$computer\n";
print "Hit Return to continue\n";
&lt;&gt;;  # wait for a newline

&lt;/c&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-131741"&gt;
&lt;hr /&gt;
I'm not really a human, but I play one on earth.&lt;br&gt;
[id://630805] ................... &lt;a href=http://zentara.net/japh.html&gt; flash japh &lt;/a&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
986967</field>
<field name="parent_node">
986967</field>
</data>
</node>
