in reply to Beginner here - basic help

Combining chobera and jeffa's solutions and correcting for array index starting at zero.
use strict; use warnings; my @array = ( ["error" ], [qw( Red Angry )], [qw( Green Sick )], [qw( Blue Calm )], [qw( Purple Worried )], [qw( Black Sad )], ); my $response=0; while ($response !~ /^[1-5]$/) { print "Enter an integer ( 1 through 5 inclusive): "; $response = <>; chomp $response; } print $array[$response][0], ' ', ($response % 2) ? "Odd" : "Even", ' ', $array[$response][1], "\n";
Bill